Skip to main content
View source

Perplexity

View as Markdown

A RocketRide LLM node that connects Perplexity AI's Sonar models to a pipeline with built-in real-time web search.

What it does​

Routes questions through Perplexity AI's Sonar family of models, each of which grounds responses in current web content rather than training data alone. The node is registered with classType: llm and the invoke capability, so agents and other LLM-consuming nodes can use it as a drop-in model connection. It can also be driven directly via the questions/answers lane pair.

Uses langchain-openai (ChatOpenAI) against Perplexity's OpenAI-compatible endpoint at https://api.perplexity.ai. Temperature is fixed at 0. The SDK's built-in retries are disabled; the node manages its own retry loop with per-model timeouts and exponential backoff (see "Timeouts and retries" below). Prompt length is checked against the model's token limit before each request, using a word-based estimate (approximately 0.75 words per token).

Lanes​

Lane inLane outDescription
questionsanswersSend a question directly, receive a generated answer

Profiles​

Default: Sonar (sonar).

ProfileModelContext tokensOutput tokensModel source
sonar (default)sonar127,072114,364manual
sonar-prosonar-pro200,0008,000manual
sonar-reasoning-prosonar-reasoning-pro128,000115,200manual
sonar-reasoningsonar-reasoning128,0004,096manual
sonar-deep-researchsonar-deep-research128,000115,200manual
sonar-pro-searchsonar-pro-search200,0008,000OpenRouter

All profiles except sonar-pro-search use manually configured model metadata. The sonar-pro-search profile pulls token limits from OpenRouter.

Configuration​

Choose a Sonar profile for the search and reasoning depth the pipeline needs. The profile supplies the model ID, context window, and output budget; only the Perplexity API key normally needs to be supplied.

Authentication​

Set apikey to a valid Perplexity AI API key in the selected profile's config panel. The key is validated at save time by sending a minimal 10-token probe request ("Hi") to https://api.perplexity.ai. If the probe fails, a concise warning is surfaced rather than a raw error dump. For HTTP 401 responses that return an HTML page (a known Perplexity behavior), the node extracts the page title or <h1> text and formats it into a readable message.

To obtain an API key, visit https://www.perplexity.ai/settings/api.

Notes​

Timeouts and retries​

Request timeout and retry behavior scale with model complexity:

Model(s)TimeoutMax retriesBase delay
sonar-deep-research180 s32.0 s
sonar-reasoning* models120 s21.5 s
All other models60 s21.0 s

Retries use exponential backoff (base_delay x 2^attempt) and only fire on transient failures: timeouts, connection/network errors, and HTTP 500/502/503/504 responses. Authentication errors, quota/billing errors, and input validation errors fail immediately without retrying.

After all retries are exhausted, raw API errors are translated into concise user-facing messages covering: bad API key, rate limiting, quota/billing issues, invalid input, model unavailability, content policy violations, timeouts, and network errors.

Upstream docs​


Schema​

FieldTypeDescriptionDefault
modelstringModel
Perplexity AI model
modelTotalTokensnumberTokens
Total Tokens
perplexity.profilestringModel
Perplexity AI model
"sonar"

Dependencies​

  • openai
  • langchain-openai
  • langchain-core
  • langchain