Skip to main content
View source

Baidu Qianfan

View as Markdown

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 inLane outDescription
questionsanswersSend a question directly, receive a generated answer

Profiles

Default: ERNIE 4.5 Turbo 128K (ernie-4-5-turbo-128k).

ProfileModelContext tokensOutput tokens
ernie-4-5-turbo-128k (default)ernie-4.5-turbo-128k128,0004,096
ernie-4-5-turbo-32kernie-4.5-turbo-32k32,7684,096
ernie-5-0-thinking-previewernie-5.0-thinking-preview128,0008,192
custom(user-specified)32,7684,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

FieldTypeDescriptionDefault
baidu_qianfan.profilestringModel
Baidu Qianfan model selection
"ernie-4-5-turbo-128k"
baidu_qianfan.serverbasestringBase URL
Qianfan OpenAI-compatible API endpoint.
"https://qianfan.baidubce.com/v2"
modelstringModel
Baidu Qianfan model name
modelOutputTokensnumberOutput Tokens
Maximum generated tokens
modelTotalTokensnumberTokens
Maximum context length in tokens

Dependencies

  • openai
  • langchain
  • langchain-core
  • langchain-openai