协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
provider-config【开发与工程】Configure and integrate new AI providers into mimo2codex. Use when the user wants to add a new provider, configure existing ones, or troubleshoot provider connectivity issues.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Configure and integrate AI providers into the mimo2codex proxy.
Trigger this skill when:
Gather from user:
https://api.example.com/v1)Look at src/providers/ for examples:
mimo.ts - MiMo provider (built-in)deepseek.ts - DeepSeek provider (built-in)registry.ts - Provider registrationtypes.ts - Provider type definitionsFor generic OpenAI-compatible providers:
// In src/providers/registry.ts or config
{
id: "provider-name",
shortcut: "provider-name",
displayName: "Provider Display Name",
baseUrl: "https://api.example.com/v1",
models: ["model-1", "model-2"],
wireApi: "openai-chat", // or "custom"
apiKeyEnv: "PROVIDER_API_KEY",
}
Common compatibility issues:
max_tokens vs max_completion_tokens: Some providers use different field names# Test with direct API call
curl -X POST "$BASE_URL/chat/completions" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"model-name","messages":[{"role":"user","content":"Hello"}]}'
# Test through mimo2codex
curl -X POST http://localhost:8788/v1/chat/completions \
-H "Authorization: Bearer your-key" \
-H "Content-Type: application/json" \
-d '{"model":"provider-name/model-name","messages":[{"role":"user","content":"Hello"}]}'
Add to provider documentation:
User: 按要求配置:{ "providers": [ { "id": "sensenova", "shortcut": "sensenova", "displayName": "商汤日日新", "baseUrl": "..." } ] }
Agent workflow:
1. Parse the provider configuration JSON
2. Check if provider needs special handling
3. Add to registry.ts or config
4. Test the integration
5. Document any quirks found
| Provider | Wire API | Vision | Tools | Streaming | Notes |
|---|---|---|---|---|---|
| MiMo | openai-chat | ✅ | ✅ | ✅ | Built-in, max_completion_tokens |
| DeepSeek | openai-chat | ❌ | ✅ | ✅ | Built-in, reasoning_content |
| MiniMax | openai-chat | ✅ | ✅ | ✅ | May need dropResponseFormat |
| Generic | openai-chat | ? | ? | ? | Depends on implementation |
{
"id": "my-provider",
"shortcut": "my-provider",
"displayName": "My AI Provider",
"baseUrl": "https://api.my-provider.com/v1",
"models": ["gpt-4", "gpt-3.5-turbo"],
"wireApi": "openai-chat",
"apiKeyEnv": "MY_PROVIDER_API_KEY"
}
{
"id": "custom-ai",
"shortcut": "custom-ai",
"displayName": "Custom AI",
"baseUrl": "https://custom-ai.example.com/api",
"models": ["custom-model-v1"],
"wireApi": "custom",
"apiKeyEnv": "CUSTOM_AI_KEY",
"transformRequest": "custom-transform.ts",
"transformResponse": "custom-transform.ts"
}
stream: true in requesttool_choice support# Print current config
node dist/cli.js print-config
# Print cc-switch config
node dist/cli.js print-cc-switch
# Test provider directly
curl -X POST "$BASE_URL/chat/completions" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"model-name","messages":[{"role":"user","content":"test"}]}'
# Check mimo2codex logs
tail -f ~/.mimo2codex/logs/proxy.log