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.
Lanes
| Lane in | Lane out | Description |
|---|---|---|
questions | answers | Send a question directly, receive a generated answer |
Profiles
Default: ERNIE 4.5 Turbo 128K (ernie-4-5-turbo-128k).
| 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-specified) | 32,768 | 4,096 |
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.
Configuration
Choose a named profile for a supported ERNIE model or custom for another model on
your account. Named profiles provide the model and token budgets; most pipelines only
need an API key and the correct regional endpoint.
Base URL
Use https://qianfan.baidubce.com/v2 for keys issued in China (the default) or
https://api.baiduqianfan.ai/v1 for international keys. The endpoint and key must
belong to the same Qianfan environment.
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.
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