/install ernie-integration
ERNIE Model Integration
Complete guide for adding Baidu ERNIE 5.0 (Qianfan) models to Clawdbot.
Overview
ERNIE 5.0 is Baidu's latest large language model with deep thinking capabilities:
- ERNIE 5.0 (
ernie-5.0-thinking-preview) - Advanced reasoning model with 128K context window via OpenAI-compatible API
Prerequisites
- Clawdbot installed and configured
- API key from Baidu Qianfan platform (see Getting API Key section)
Getting API Key
Baidu Qianfan Platform
- Visit https://console.bce.baidu.com/qianfan/ais/console/applicationConsole/application
- Register a Baidu Cloud account if you don't have one
- Navigate to the API Keys section
- Create a new API key
- Copy the key (format:
bce-v3/ALTAK-...)
Note: The API key uses Baidu's BCE authentication format.
Integration Steps
Step 1: Set environment variable
Add to ~/.bashrc or ~/.zshrc for persistence:
export ERNIE_API_KEY="bce-v3/ALTAK-your-key-here"
source ~/.zshrc # or source ~/.bashrc
Security note: Never commit API keys to version control. Rotate keys regularly on the Qianfan console.
Step 2: Add provider configuration
Edit your clawdbot.json config:
{
"agents": {
"defaults": {
"model": {
"primary": "ernie/ernie-5.0-thinking-preview"
},
"models": {
"ernie/ernie-5.0-thinking-preview": {
"alias": "ernie-5.0"
}
}
}
},
"models": {
"mode": "merge",
"providers": {
"ernie": {
"baseUrl": "https://qianfan.baidubce.com/v2",
"apiKey": "${ERNIE_API_KEY}",
"api": "openai-completions",
"models": [
{
"id": "ernie-5.0-thinking-preview",
"name": "ERNIE 5.0",
"contextWindow": 128000,
"maxTokens": 65536
}
]
}
}
}
}
Step 3: Restart Clawdbot
clawdbot gateway restart
Step 4: Verify integration
clawdbot models list
You should see ERNIE models in the list.
Step 5: Use the model
Set as default:
clawdbot models set ernie/ernie-5.0-thinking-preview
Or use model alias in chat:
/model ernie-5.0
Model Parameters
ERNIE 5.0 Specifications
| Parameter | Value |
|---|---|
| Model ID | ernie-5.0-thinking-preview |
| Context Window | 128K tokens |
| Max Input | 119K tokens |
| Max Output | 1 - 65536 tokens |
| RPM (Rate Per Minute) | 60 |
| TPM (Tokens Per Minute) | 150,000 |
Supported Request Parameters
| Parameter | Type | Description |
|---|---|---|
model |
string | Model ID (required) |
messages |
array | Chat context messages (required) |
stream |
boolean | Enable streaming response |
temperature |
number | Output randomness (model-specific range) |
top_p |
number | Nucleus sampling parameter |
max_tokens |
integer | Maximum output tokens |
stop |
array | Stop sequences (up to 4 elements) |
frequency_penalty |
number | Frequency-based repetition penalty |
presence_penalty |
number | Presence-based repetition penalty |
Thinking Mode Parameters
ERNIE 5.0 supports deep thinking mode:
| Parameter | Type | Description |
|---|---|---|
enable_thinking |
boolean | Enable thinking mode |
thinking_budget |
integer | Max thinking chain tokens (default: 16384) |
thinking_strategy |
string | short_think or chain_of_draft |
reasoning_effort |
string | low, medium (default), or high |
Troubleshooting
Model not appearing in list
Check config syntax:
clawdbot gateway config.get | grep -A 20 ernie
Verify API key is set:
echo $ERNIE_API_KEY
Authentication errors
- Verify API key format is
bce-v3/ALTAK-... - Check key is valid on Qianfan console
- Ensure correct base URL:
https://qianfan.baidubce.com/v2
Connection issues
Test API endpoint directly:
curl -X POST "https://qianfan.baidubce.com/v2/chat/completions" \
-H "Authorization: Bearer $ERNIE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "ernie-5.0-thinking-preview", "messages": [{"role": "user", "content": "test"}]}'
Rate limit errors
ERNIE 5.0 has the following rate limits:
- RPM: 60 requests per minute
- TPM: 150,000 tokens per minute
If you hit rate limits, reduce request frequency or apply for higher quotas on Qianfan console.
Model Recommendations
- ERNIE 5.0 (
ernie/ernie-5.0-thinking-preview) - Best for complex reasoning tasks, deep analysis, and tasks requiring extensive thinking
References
- Baidu Qianfan Docs: https://cloud.baidu.com/doc/WENXINWORKSHOP/index.html
- Qianfan API Reference: https://cloud.baidu.com/doc/WENXINWORKSHOP/s/Fm2vrveyu
- Clawdbot Model Providers: https://docs.openclaw.ai/concepts/model-providers
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install ernie-integration - 安装完成后,直接呼叫该 Skill 的名称或使用
/ernie-integration触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
ernie-integration 是什么?
Step-by-step guide for integrating Baidu ERNIE 5.0 (Qianfan) models into Clawdbot. Use when someone asks how to add ERNIE models, configure Baidu Qianfan, or... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 287 次。
如何安装 ernie-integration?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install ernie-integration」即可一键安装,无需额外配置。
ernie-integration 是免费的吗?
是的,ernie-integration 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
ernie-integration 支持哪些平台?
ernie-integration 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 ernie-integration?
由 Mattheliu(@mattheliu)开发并维护,当前版本 v1.0.4。