Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 96 additions & 0 deletions docs/providers/parallel_ai.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Parallel AI
https://parallel.ai

Parallel AI provides a web-research model through an OpenAI Responses-compatible endpoint: it answers questions using live multi-step web research and returns fully cited answers. API reference: [docs.parallel.ai](https://docs.parallel.ai/responses-api/responses-quickstart)

| Property | Details |
|-------|-------|
| Description | Web-research model grounded in Parallel's index of the web |
| Provider Route on LiteLLM | `parallel_ai/` |
| Supported Endpoints | `/v1/responses` (native), `/chat/completions` and `/v1/messages` (via LiteLLM's responses bridge), `/v1/search` |
| API Reference | [Parallel Responses API docs](https://docs.parallel.ai/responses-api/responses-quickstart) |

## API Key

```python
# env variable; PARALLEL_API_KEY is read as a fallback
os.environ['PARALLEL_AI_API_KEY']
```

`PARALLEL_AI_API_BASE` overrides the default base URL (`https://api.parallel.ai`). When a request supplies its own `api_base` that is neither the default nor `PARALLEL_AI_API_BASE`, it must also supply an explicit `api_key`; the server-managed key is never sent to other hosts.

## Responses API

The single `parallel_ai/parallel` model runs live web research per request. `reasoning.effort` selects the research tier: `low` (~5-10s), `medium` (~15-20s, default), or `high` (~30-60s). Web grounding is automatic, so `tools` is not supported; structured output via `text.format`, `instructions`, `stream`, and `previous_response_id` are.

The tier aliases pin the effort and bill at their own per-request rate, so spend tracking matches the tier you use:

| Model | Effort | Price per request |
|-------|--------|-------------------|
| `parallel_ai/parallel-low` | low | $0.01 |
| `parallel_ai/parallel` or `parallel_ai/parallel-medium` | medium | $0.05 |
| `parallel_ai/parallel-high` | high | $0.25 |

<Tabs>
<TabItem value="sdk" label="SDK">

```python
from litellm import responses
import os

os.environ['PARALLEL_AI_API_KEY'] = ""
response = responses(
model="parallel_ai/parallel",
input="What company acquired Windsurf in 2025?",
reasoning={"effort": "low"}
)
print(response.output_text)
```

</TabItem>
<TabItem value="proxy" label="PROXY">

```yaml
model_list:
- model_name: parallel-research
litellm_params:
model: parallel_ai/parallel
api_key: os.environ/PARALLEL_AI_API_KEY
```

```bash
curl http://0.0.0.0:4000/v1/responses \
-H "Authorization: Bearer sk-1234" \
-H "Content-Type: application/json" \
-d '{
"model": "parallel-research",
"input": "What company acquired Windsurf in 2025?",
"reasoning": {"effort": "low"}
}'
```

</TabItem>
</Tabs>

## Chat Completions and Messages

The same model also serves `/v1/chat/completions` and `/v1/messages` through LiteLLM's responses bridge, so OpenAI- and Anthropic-format clients work without changes:

```python
from litellm import completion
import os

os.environ['PARALLEL_AI_API_KEY'] = ""
response = completion(
model="parallel_ai/parallel",
messages=[{"role": "user", "content": "What did Parallel Web Systems announce this year?"}]
)
print(response.choices[0].message.content)
```

## Search

Parallel AI is also a search provider; see [Parallel AI Search](../search/parallel_ai).
4 changes: 3 additions & 1 deletion docs/proxy/config_settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,9 @@ router_settings:
| OPENAI_PROJECT | OpenAI project ID sent on OpenAI requests, equivalent to passing `project`
| OR_API_KEY | API key for OpenRouter, read after `OPENROUTER_API_KEY`
| OVHCLOUD_API_BASE | Base URL for OVHcloud AI Endpoints
| PARALLEL_AI_API_BASE | Base URL for the Parallel AI search provider
| PARALLEL_AI_API_BASE | Base URL for the Parallel AI provider (search and Responses API)
| PARALLEL_AI_API_KEY | API key for Parallel AI
| PARALLEL_API_KEY | API key for Parallel AI, read when `PARALLEL_AI_API_KEY` is unset
| PERPLEXITY_API_BASE | Base URL for Perplexity. Default is https://api.perplexity.ai
| PG_VECTOR_API_BASE | Base URL for a pgvector vector store
| PG_VECTOR_API_KEY | API key for a pgvector vector store
Expand Down
23 changes: 19 additions & 4 deletions docs/search/parallel_ai.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,34 @@ curl http://0.0.0.0:4000/v1/search/parallel-search \

## Provider-specific Parameters

Every parameter of Parallel's [v1 Search API](https://docs.parallel.ai/api-reference/search/search) can be passed. Flat parameters are mapped into the nested v1 request shape; anything else passes through to the request body as-is.

```python showLineNumbers title="Parallel AI Search with Provider-specific Parameters"
import os
from litellm import search

os.environ["PARALLEL_AI_API_KEY"] = "..."
os.environ["PARALLEL_AI_API_KEY"] = "..." # PARALLEL_API_KEY works as a fallback

response = search(
query="latest developments in quantum computing",
search_provider="parallel_ai",
max_results=5,
# Parallel AI-specific parameters
processor="pro", # 'base' or 'pro'
max_chars_per_result=500 # Max characters per result
mode="advanced", # 'turbo', 'basic' (default), or 'advanced'
objective="find peer-reviewed research", # natural-language search goal
include_domains=["arxiv.org"], # restrict results to these domains
exclude_domains=["reddit.com"], # drop results from these domains
after_date="2026-01-01", # only content published on/after this date
location="us", # ISO 3166-1 alpha-2 geo-targeting
max_chars_per_result=500, # max excerpt characters per result
max_chars_total=4000, # max excerpt characters across all results
fetch_policy={"max_age_seconds": 600}, # cached vs live-fetch behavior
session_id="session-123", # ties related search/extract calls together
)
```

The legacy `processor` parameter still works: `'base'` maps to `mode='basic'` and `'pro'` to `mode='advanced'`.

## Response

Results follow LiteLLM's unified search format. Parallel's raw metadata is preserved on top: the response carries `search_id`, `session_id`, `parallel_usage` (billing SKUs), and `warnings`, and each result keeps its raw `excerpts` array alongside the joined `snippet`.

1 change: 1 addition & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -1181,6 +1181,7 @@ const sidebars = {
type: "category",
label: "Perplexity AI",
items: [
"providers/parallel_ai",
"providers/perplexity",
"providers/perplexity_embedding",
]
Expand Down