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).
Configuration
| Field | Type / Default | Description |
|---|---|---|
profile | enum, default sonar | Which Sonar model profile to activate (see Profiles) |
apikey | string | Perplexity AI API key for the selected profile |
model | string (per profile) | Perplexity model identifier, set automatically by profile |
modelTotalTokens | number (per profile) | Total context window in tokens |
modelOutputTokens | number (per profile) | Maximum output tokens per response |
The model, modelTotalTokens, and modelOutputTokens values are preset by the chosen profile; only apikey needs to be supplied per profile.
Lanes
| Lane in | Lane out | Description |
|---|---|---|
questions | answers | Send a question directly, receive a generated answer |
Profiles
| Profile | Model | Context (tokens) | Max output | Model source |
|---|---|---|---|---|
| Sonar (default) | sonar | 127,072 | 4,096 | manual |
| Sonar Pro | sonar-pro | 200,000 | 8,000 | manual |
| Sonar Reasoning | sonar-reasoning | 128,000 | 4,096 | manual |
| Sonar Reasoning Pro | sonar-reasoning-pro | 128,000 | 4,096 | manual |
| Sonar Deep Research | sonar-deep-research | 128,000 | 4,096 | manual |
| Perplexity: 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.
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.
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.
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-pro" |
Dependencies
openailangchain-openailangchain-corelangchain