Baidu Qianfan
A RocketRide LLM node that calls Baidu Qianfan ERNIE chat models through Qianfan's OpenAI-compatible chat-completions API.
What it does
Connects a pipeline to Baidu Qianfan ERNIE large language models for chat-based text
generation, question answering, summarization, and Chinese-language enterprise AI
workflows. Questions arriving on the questions lane are answered by the configured
ERNIE model and emitted on the answers lane.
Uses langchain-openai (ChatOpenAI) over the openai Python SDK, pointed at
Qianfan's OpenAI-compatible endpoint. Temperature is fixed at 0 for deterministic
output, and generation is capped at the profile's output-token limit.
When you save the node configuration, the node validates it live: it sends a tiny test
completion ("Hi", max 8 tokens) to the configured endpoint and surfaces a specific
warning for an invalid API key, an empty model name, a non-positive token limit, a rate
limit, an unreachable base URL, or any other API error.
At runtime, rate-limit and connection errors are treated as retryable; authentication and other API errors fail immediately with a user-facing message.
Configuration
Lanes
| Lane | Direction | Description |
|---|---|---|
questions | input | Prompts / questions to send to the model |
answers | output | Model completions |
Fields
The node is configured through a single Model profile selector plus the fields that profile exposes.
| Field | Type | Description |
|---|---|---|
model | string | Baidu Qianfan model name |
modelTotalTokens | number | Maximum context length in tokens |
modelOutputTokens | number | Maximum generated tokens |
serverbase | string | Default "https://qianfan.baidubce.com/v2". Qianfan OpenAI-compatible API endpoint. |
profile | string | Default "ernie-4-5-turbo-128k". Baidu Qianfan model selection |
Model profiles
| Profile | Model | Context tokens | Output tokens |
|---|---|---|---|
| ERNIE 4.5 Turbo 128K (default) | ernie-4.5-turbo-128k | 128,000 | 4,096 |
| ERNIE 4.5 Turbo 32K | ernie-4.5-turbo-32k | 32,768 | 4,096 |
| ERNIE 5.0 Thinking Preview | ernie-5.0-thinking-preview | 128,000 | 8,192 |
| Custom | user-supplied | 32,768 (editable) | 4,096 (editable) |
The named profiles pin the model name and token limits; only the API key, base URL, and
model source are editable. The Custom profile additionally exposes model,
modelTotalTokens, and modelOutputTokens so you can target any model available on
your Qianfan account.
Authentication
Provide a Qianfan API key in apikey: it is required, and the node refuses to start
without one. The key must have access to the selected model.
Pick the base URL matching where your key was issued:
- China (default):
https://qianfan.baidubce.com/v2 - International:
https://api.baiduqianfan.ai/v1
An invalid or unauthorized key is reported as "Baidu Qianfan API key is invalid or unauthorized" both at save-time validation and at runtime.
Schema
| Field | Type | Description | Default |
|---|---|---|---|
baidu_qianfan.profile | string | Model Baidu Qianfan model selection | "ernie-4-5-turbo-128k" |
baidu_qianfan.serverbase | string | Base URL Qianfan OpenAI-compatible API endpoint. | "https://qianfan.baidubce.com/v2" |
model | string | Model Baidu Qianfan model name | |
modelOutputTokens | number | Output Tokens Maximum generated tokens | |
modelTotalTokens | number | Tokens Maximum context length in tokens |
Dependencies
openailangchainlangchain-corelangchain-openai