← 返回
AI智能 Key

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...
将百度ERNIE 5.0(千帆)模型集成至Clawdbot的分步指南。当用户询问如何添加ERNIE模型、配置百度千帆或相关问题时使用。
mattheliu
AI智能 clawhub v1.0.4 1 版本 100000 Key: 需要
★ 0
Stars
📥 515
下载
💾 10
安装
1
版本
#latest

概述

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

  1. Visit https://console.bce.baidu.com/qianfan/ais/console/applicationConsole/application
  2. Register a Baidu Cloud account if you don't have one
  3. Navigate to the API Keys section
  4. Create a new API key
  5. 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

ParameterValue
------------------
Model IDernie-5.0-thinking-preview
Context Window128K tokens
Max Input119K tokens
Max Output1 - 65536 tokens
RPM (Rate Per Minute)60
TPM (Tokens Per Minute)150,000

Supported Request Parameters

ParameterTypeDescription
------------------------------
modelstringModel ID (required)
messagesarrayChat context messages (required)
streambooleanEnable streaming response
temperaturenumberOutput randomness (model-specific range)
top_pnumberNucleus sampling parameter
max_tokensintegerMaximum output tokens
stoparrayStop sequences (up to 4 elements)
frequency_penaltynumberFrequency-based repetition penalty
presence_penaltynumberPresence-based repetition penalty

Thinking Mode Parameters

ERNIE 5.0 supports deep thinking mode:

ParameterTypeDescription
------------------------------
enable_thinkingbooleanEnable thinking mode
thinking_budgetintegerMax thinking chain tokens (default: 16384)
thinking_strategystringshort_think or chain_of_draft
reasoning_effortstringlow, 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

版本历史

共 1 个版本

  • v1.0.4 当前
    2026-03-19 09:55 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,349 📥 317,678
ai-intelligence

ontology

oswalpalash
类型化知识图谱,用于结构化智能体记忆与可组合技能。支持创建/查询实体(人员、项目、任务、事件、文档)及关联...
★ 709 📥 243,509
ai-intelligence

Proactive Agent

halthelobster
将AI智能体从任务执行者升级为主动预判需求、持续优化的智能伙伴。集成WAL协议、工作缓冲区、自主定时任务及实战验证模式。Hal Stack核心组件 🦞
★ 833 📥 212,747