Home Tutorials Categories Skills About
ZH EN JA KO
Model Integration

Baidu Qianfan Model Platform Integration Guide

· 5 min read

Baidu Qianfan Introduction

Baidu Qianfan is an enterprise-grade AI development platform offering the ERNIE (Wenxin) series of models along with many third-party models. Qianfan excels at Chinese language understanding and generation, making it particularly well-suited for Chinese-facing OpenClaw deployments.

Get API Credentials

  1. Visit qianfan.baidubce.com and register
  2. Create an application and obtain API Key
  3. Enable the model services you need

Basic Configuration

{
  "providers": {
    "qianfan": {
      "type": "openai",
      "baseUrl": "https://qianfan.baidubce.com/v2",
      "apiKey": "{{QIANFAN_API_KEY}}",
      "models": ["ernie-4.0-8k", "ernie-3.5-8k", "ernie-speed-8k", "ernie-lite-8k"]
    }
  }
}

Model Selection

Model Features Use Case
ernie-4.0-8k Flagship, strongest capabilities Complex reasoning, creative writing
ernie-3.5-8k Balanced performance and cost General conversation
ernie-speed-8k Fast response Simple Q&A
ernie-lite-8k Lightweight, economical High-volume simple tasks
ernie-char-8k Role-playing Virtual character conversation

Role-Playing Configuration

Leverage the ERNIE-Char model for virtual characters:

{
  "skills": {
    "virtual-teacher": {
      "model": "ernie-roleplay",
      "systemPrompt": "You are a patient teacher who excels at explaining complex concepts in simple terms."
    }
  }
}

Network Optimization

Qianfan API servers are located in China, offering extremely low latency from Chinese servers. For overseas OpenClaw deployments, consider using a Chinese server or CDN acceleration.

Content Safety

Qianfan has built-in content safety reviews. Non-compliant content is automatically filtered.

Summary

Baidu Qianfan is an excellent choice for Chinese-facing OpenClaw deployments. The ERNIE series excels in Chinese language scenarios, and with servers in China, latency is minimal.

OpenClaw is a free, open-source personal AI assistant that supports WhatsApp, Telegram, Discord, and many more platforms