Skip to content

智能路由(按工作类型选模型)

anyCode 允许按 agent_type 覆盖模型与端点,从而实现:

  • 规划(plan)用更强模型
  • 探索(explore)用更快/更便宜模型
  • 总结(summary)用单独 profile(或复用 plan)

配置示例

编辑 ~/.anycode/config.json

json
{
  "routing": {
    "agents": {
      "plan": { "model": "glm-5", "plan": "general" },
      "explore": { "model": "glm-4.7", "plan": "coding" },
      "summary": { "model": "glm-5", "plan": "general" }
    }
  }
}

优先级

  1. routing.agents.<agent_type>
  2. summary 阶段:routing.agents.summaryrouting.agents.plan → default
  3. 全局 model/plan/base_url

工作区覆盖与全局默认

CLI 可能根据当前目录应用 workspace::apply_project_overlays:匹配 ~/.anycode/workspace/projects/index.json 时,内存中的 default_mode / label / channel_profile** 来自项目登记(不写回 **config.json**)。**provider/model` / routing 仍以全局配置为准。

runtime.model_routes

mode_aliases 键为运行模式(generalplancodeexplorechannelgoal)。与内置路由器一致的文档化默认值:ModelRouteProfile::documented_mode_alias_defaults()

YAML 工作流示例

仓库内 workflow.example.yml

English: Routing.

MIT License