Documentation Index
Fetch the complete documentation index at: https://mintlify.com/sipeed/picoclaw/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Zhipu AI provider enables access to GLM (General Language Model) series from Zhipu AI (智谱AI). These models are optimized for Chinese language tasks and provide excellent performance for both Chinese and English.Configuration
Model List Format
Add Zhipu models to yourmodel_list configuration:
Configuration Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model_name | string | Yes | - | Alias for this model configuration |
model | string | Yes | - | Model identifier with zhipu/ prefix |
api_key | string | Yes | - | Your Zhipu AI API key |
api_base | string | No | https://open.bigmodel.cn/api/paas/v4 | API endpoint URL |
request_timeout | integer | No | 120 | Request timeout in seconds |
Available Models
Zhipu AI provides several GLM model families:GLM-4 Series (Latest)
zhipu/glm-4.7- Latest GLM-4 model, best performancezhipu/glm-4- GLM-4 base modelzhipu/glm-4-plus- Enhanced GLM-4 with improved capabilitieszhipu/glm-4-air- Lightweight GLM-4 variantzhipu/glm-4-flash- Fast inference variant
GLM-3 Series
zhipu/glm-3-turbo- Fast GLM-3 model
Specialized Models
zhipu/glm-4v- Vision-capable model (multimodal)zhipu/glm-4-alltools- Model with enhanced tool-calling capabilities
GLM-4 models use
max_completion_tokens instead of max_tokens. PicoClaw handles this automatically.Setup Instructions
1. Get API Key
- Visit Zhipu AI Platform
- Sign in or create an account (可使用微信登录)
- Navigate to API密钥管理 (API Key Management)
- Click 创建新的APIKey (Create New API Key)
- Copy your API key
2. Configure PicoClaw
Edit~/.picoclaw/config.json:
3. Test Connection
Advanced Configuration
Custom API Endpoint
Use a custom endpoint (e.g., for enterprise deployments):Load Balancing
Configure multiple API keys for load balancing:model_name.
Multimodal (Vision) Support
Use GLM-4V for image understanding:Protocol Details
Zhipu AI uses OpenAI-compatible API protocol:- Endpoint:
/chat/completions - Authentication: Bearer token via
Authorizationheader - Request format: OpenAI-compatible JSON
- Response format: OpenAI-compatible JSON
- Strips
zhipu/prefix when sending requests - Uses
max_completion_tokensfor GLM-4 models - Handles tool calling in OpenAI format
Troubleshooting
Content Filtering
Zhipu AI has content safety filters. If you receive filtering errors:- Rephrase your query to avoid sensitive topics
- Use different wording
- Check Zhipu’s content policy guidelines
Rate Limiting
Free tier has rate limits:- Configure multiple API keys for load balancing
- Upgrade to paid plan for higher limits
- Implement request throttling
Invalid API Key
Error:401 Unauthorized
- Verify your API key is correct
- Check key hasn’t expired
- Ensure sufficient credits in your account
Timeout Errors
Increase timeout for complex requests:Model Selection Guide
| Use Case | Recommended Model | Notes |
|---|---|---|
| Chinese tasks | glm-4.7 | Best for Chinese language |
| General tasks | glm-4-plus | Enhanced capabilities |
| Fast responses | glm-4-flash | Optimized for speed |
| Vision tasks | glm-4v | Supports image input |
| Tool calling | glm-4-alltools | Enhanced function calling |
| Cost-sensitive | glm-4-air | Lightweight and economical |
Cost Optimization
- Choose appropriate models: Use
glm-4-airfor simple tasks,glm-4.7for complex tasks - Set
max_tokens: Limit response length to reduce costs - Monitor usage: Check Zhipu Console regularly
- Use load balancing: Distribute requests across multiple free-tier keys
- Leverage free tier: 200K tokens/month free
Free Tier
Zhipu AI offers generous free tier:- 200K tokens per month for free
- No credit card required
- Ideal for personal projects and testing
Language Support
GLM models excel at:- Chinese: Native language, best performance
- English: Good performance for English tasks
- Code: Strong coding capabilities
- Mixed: Handles Chinese-English mixed content well
Legacy Configuration (Deprecated)
Older configuration format (still supported):model_list format for better features like load balancing and fallbacks.