Skip to main content
Parallel is a real-time web search and content extraction platform built for LLMs and AI applications.
ChatParallel is an OpenAI-compatible chat interface to Parallel’s models. The speed model is a low-latency conversational model with no citations; the research models (lite, base, core) browse the web and return per-field citations and structured output via JSON schema.
ChatParallel is the canonical class name. The earlier ChatParallelWeb continues to work as an alias for the same class.

Overview

Integration details

Model features

Choosing a model

speed does not honor response_format, so with_structured_output() raises a clear error there. Use a research model when you need parsed pydantic output or per-field citations.

Setup

To access Parallel models, install the langchain-parallel integration package and acquire a Parallel API key.

Installation

Credentials

Head to Parallel to sign up and generate an API key. Set PARALLEL_API_KEY in your environment:

Instantiation

See the ChatParallel API reference for the full set of available parameters.

Invocation

Chaining

Chain the model with a prompt template:

Structured output

On the research models (lite, base, core), ChatParallel.with_structured_output(...) binds a JSON-schema response_format and returns a parsed pydantic object (or dict). Calling it on speed raises a ValueError, since speed silently ignores response_format.
method="json_schema" (the default), method="json_mode", and method="function_calling" are all accepted. Pass include_raw=True to receive the full {"raw", "parsed", "parsing_error"} envelope and capture parser failures:

Citations

Research models populate AIMessage.response_metadata["basis"] with per-field citations, the model’s reasoning, and a confidence label. response_metadata["interaction_id"] is surfaced for multi-turn context chaining; system_fingerprint is forwarded when present.

Streaming

ChatParallel supports per-token streaming:

Async

Token usage

Parallel does not currently provide token usage metadata. usage_metadata is None.

Response metadata

For research models, response_metadata additionally carries basis (per-field citations), interaction_id (for multi-turn chaining), and system_fingerprint when available.

Error handling

The integration raises ValueError with a descriptive message on common failure modes:

OpenAI compatibility

ChatParallel accepts many OpenAI Chat Completions API parameters for drop-in OpenAI-client migration. Advanced parameters such as tools, tool_choice, top_p, and frequency_penalty are accepted but ignored by the Parallel API.
For structured output, prefer ChatParallel.with_structured_output(...) (see Structured output) over passing response_format directly. It works on the research models and returns a parsed object.

Message handling

The integration merges consecutive messages of the same type to satisfy API requirements:

API reference

For detailed documentation, head to the ChatParallel API reference or the Parallel chat API quickstart.