Perplexity
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 in | Lane out | Description |
|---|---|---|
questions | answers | Send a question directly, receive a generated answer |
Profiles
Default: Sonar (sonar).
| Profile | Model | Context tokens | Output tokens | Model source |
|---|---|---|---|---|
sonar (default) | sonar | 127,072 | 114,364 | manual |
sonar-pro | sonar-pro | 200,000 | 8,000 | manual |
sonar-reasoning-pro | sonar-reasoning-pro | 128,000 | 115,200 | manual |
sonar-reasoning | sonar-reasoning | 128,000 | 4,096 | manual |
sonar-deep-research | sonar-deep-research | 128,000 | 115,200 | manual |
sonar-pro-search | sonar-pro-search | 200,000 | 8,000 | OpenRouter |
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) | Timeout | Max retries | Base delay |
|---|---|---|---|
sonar-deep-research | 180 s | 3 | 2.0 s |
sonar-reasoning* models | 120 s | 2 | 1.5 s |
| All other models | 60 s | 2 | 1.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
| Field | Type | Description | Default |
|---|---|---|---|
model | string | Model Perplexity AI model | |
modelTotalTokens | number | Tokens Total Tokens | |
perplexity.profile | string | Model Perplexity AI model | "sonar" |
Dependencies
openailangchain-openailangchain-corelangchain