Agent Skills7as0nch/mimo2codex › provider-config

provider-config

GitHub

用于在mimo2codex中配置、集成新AI提供商或排查连接问题。涵盖获取需求、参考现有模式、创建配置、处理兼容性差异及测试验证全流程,支持OpenAI兼容及自定义格式提供商。

.mimocode/skills/provider-config/SKILL.md 7as0nch/mimo2codex

触发场景

用户希望添加新的AI提供商 用户提供提供商配置JSON 用户要求配置特定提供商 用户遇到提供商连接故障 用户询问提供商兼容性

安装

npx skills add 7as0nch/mimo2codex --skill provider-config -g -y
更多选项

非标准路径

npx skills add https://github.com/7as0nch/mimo2codex/tree/main/.mimocode/skills/provider-config -g -y

不安装直接使用

npx skills use 7as0nch/mimo2codex@provider-config

指定 Agent (Claude Code)

npx skills add 7as0nch/mimo2codex --skill provider-config -a claude-code -g -y

安装 repo 全部 skill

npx skills add 7as0nch/mimo2codex --all -g -y

预览 repo 内 skill

npx skills add 7as0nch/mimo2codex --list

SKILL.md

Frontmatter
{
    "name": "provider-config",
    "description": "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."
}

Provider Configuration Skill

Configure and integrate AI providers into the mimo2codex proxy.

When to use

Trigger this skill when:

  • User wants to add a new provider (e.g., "接入MiniMax", "add a new provider")
  • User provides provider configuration JSON
  • User asks to configure a provider (e.g., "按要求配置")
  • User has provider connectivity issues
  • User asks about provider compatibility

Workflow

1. Understand Provider Requirements

Gather from user:

  • Base URL: API endpoint (e.g., https://api.example.com/v1)
  • API Key: Authentication method
  • Models: Which models to expose
  • Wire API: OpenAI-compatible? Custom format?
  • Special features: Vision, tools, streaming, etc.

2. Check Existing Provider Patterns

Look at src/providers/ for examples:

  • mimo.ts - MiMo provider (built-in)
  • deepseek.ts - DeepSeek provider (built-in)
  • registry.ts - Provider registration
  • types.ts - Provider type definitions

3. Create Provider Configuration

For 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",
}

4. Handle Provider Quirks

Common compatibility issues:

  • max_tokens vs max_completion_tokens: Some providers use different field names
  • Image input: Not all providers support vision
  • Tool calling: Some providers have limited tool support
  • Streaming: Check SSE format compatibility
  • Rate limiting: Implement retry logic if needed

5. Test Provider Integration

# 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"}]}'

6. Document Provider

Add to provider documentation:

  • Base URL and auth method
  • Supported models and capabilities
  • Known quirks or limitations
  • Example configuration

Example Usage

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 Compatibility Matrix

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

Common Configuration Patterns

For OpenAI-Compatible APIs

{
  "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"
}

For Custom APIs

{
  "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"
}

Troubleshooting

"Unauthorized" / 401 Errors

  • Check API key is correct
  • Verify API key has proper permissions
  • Check if key needs specific header format

"Model Not Found" / 404 Errors

  • Verify model name matches provider's expected format
  • Check if model is available in your region
  • Confirm model is enabled in your account

Streaming Issues

  • Check if provider supports SSE format
  • Verify stream: true in request
  • Look for newline-delimited JSON issues

Tool Calling Issues

  • Verify provider supports function calling
  • Check tool schema format compatibility
  • Look for tool_choice support

Key Commands Reference

# 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

Don't Use This Skill For

  • General API calls (use mimo_chat.py from mimoskill)
  • PR review (use pr-review skill)
  • Issue investigation (use issue-investigation skill)
  • Codebase analysis (use codebase-analysis skill)

版本历史

  • 5cb6f5c 当前 2026-07-24 12:23

同 Skill 集合

.mimocode/skills/codebase-analysis/SKILL.md
.mimocode/skills/issue-investigation/SKILL.md
.mimocode/skills/pr-review/SKILL.md

元信息

文件数
0
版本
5cb6f5c
Hash
a0e5356d
收录时间
2026-07-24 12:23

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-07 18:12
浙ICP备14020137号-1 $访客地图$