Duplicate Check / 重复检查
Problem / 问题
Today a profile maps all Claude Code model slots (haiku/sonnet/opus) to a single provider backend (base_url). [profiles.models] only renames the model string — it can't route, e.g., haiku requests to a cheap provider while sonnet/opus go to a premium one.
Use case: I'd like to run one Claude Code session where:
haiku slot → OpenCode Go (deepseek-v4-flash, API key)
sonnet/opus slots → ChatGPT Codex subscription (gpt-5.6-terra / gpt-5.6-sol, OAuth)
Proposed Solution / 建议方案
Allow each model slot to optionally reference a different profile:
[[profiles]]
name = "codex-sub"
provider_type = "OpenAIResponses"
base_url = "https://chatgpt.com/backend-api/codex"
default_model = "gpt-5.6-sol"
auth_type = "oauth"
oauth_provider = "openai"
[profiles.slot_profiles]
haiku = "opencode-go" # route haiku requests to another profile
Implementation sketch (proxy-side, in handle_messages):
- After resolving the primary profile, inspect
body["model"].
- If it matches a slot that has a
slot_profiles override, re-resolve that profile (its adapter, base_url, auth, strip_params).
- Reuse the existing translation/streaming/failover machinery — only the target
ProfileConfig changes.
This keeps the change small: config struct + one routing decision in handler.rs. Launch behavior (ANTHROPIC_DEFAULT_*_MODEL) is unchanged — the model name string is already sent per-slot.
Alternatives Considered / 备选方案
- Separate profiles per provider and switch sessions manually (current workaround — doesn't give mixed slots in one session).
- Smart Router (
[router.rules]) — intent-based, but not per-slot and requires a classifier.
Additional Context / 补充信息
Happy to work on this and open a PR with tests + bilingual docs. Let me know if you'd prefer a different config shape.
Duplicate Check / 重复检查
Problem / 问题
Today a profile maps all Claude Code model slots (
haiku/sonnet/opus) to a single provider backend (base_url).[profiles.models]only renames the model string — it can't route, e.g.,haikurequests to a cheap provider whilesonnet/opusgo to a premium one.Use case: I'd like to run one Claude Code session where:
haikuslot → OpenCode Go (deepseek-v4-flash, API key)sonnet/opusslots → ChatGPT Codex subscription (gpt-5.6-terra/gpt-5.6-sol, OAuth)Proposed Solution / 建议方案
Allow each model slot to optionally reference a different profile:
Implementation sketch (proxy-side, in
handle_messages):body["model"].slot_profilesoverride, re-resolve that profile (its adapter,base_url, auth, strip_params).ProfileConfigchanges.This keeps the change small: config struct + one routing decision in
handler.rs. Launch behavior (ANTHROPIC_DEFAULT_*_MODEL) is unchanged — the model name string is already sent per-slot.Alternatives Considered / 备选方案
[router.rules]) — intent-based, but not per-slot and requires a classifier.Additional Context / 补充信息
Happy to work on this and open a PR with tests + bilingual docs. Let me know if you'd prefer a different config shape.