Ops/zhipu anthropic deploy#4004
Open
JDHK01 wants to merge 3 commits into
Open
Conversation
Add an optional per-group `claude_code_default_models {haiku, sonnet, opus}`
config so admins can remap Claude Code's Opus/Sonnet/Haiku tiers to the model
names a given upstream accepts. Non-empty tiers are emitted into the client
configs generated by the "Use Key" modal (Terminal/CMD/PowerShell + VSCode
settings.json, as ANTHROPIC_DEFAULT_*_MODEL) and the "Import to CCS" deeplink
(haikuModel/sonnetModel/opusModel, CC Switch V1 protocol). Empty tiers are
omitted, so upstreams that natively understand Claude model names (e.g. real
Anthropic) need no configuration — no model names are hardcoded anywhere.
Backend:
- domain.ClaudeCodeDefaultModels; ent field + migration 174
- service/handler/dto wiring, including the user-side key-list payload so the
"Use Key" modal reads the mapping without an extra API call
Frontend:
- types + admin group form (anthropic-only section, mirrors the existing OpenAI
messages-dispatch pattern) + i18n (en/zh)
- UseKeyModal + ccswitchImport consume group.claude_code_default_models
dynamically; the previous hardcoded constant and its generator are removed
Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
|
All contributors have signed the CLA. ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an optional per-group Claude Code tier→model mapping so client configs generated from the admin UI work against
upstreams that don't natively understand Claude's
claude-3-haiku/opus/sonnetnames (e.g. Anthropic-compatible third-partyendpoints), without hardcoding any model names.
Admins set
claude_code_default_models {haiku, sonnet, opus}on a group (Anthropic-platform section, mirroring the existingOpenAI messages-dispatch UI). Non-empty tiers are emitted into:
settings.json, asANTHROPIC_DEFAULT_*_MODELhaikuModel/sonnetModel/opusModel(CC Switch V1 protocol)Empty tiers are omitted, so upstreams that natively understand Claude model names (e.g. real Anthropic) need no
configuration. No model names are hardcoded — values come from the group config.
Changes
Backend:
domain.ClaudeCodeDefaultModels; ent field + migration174; service/handler/dto wiring incl. the user-sidekey-list payload (so the modal reads it without an extra call).
Frontend: types + admin group form (anthropic-only) + i18n;
UseKeyModal+ccswitchImportconsume the fielddynamically.
Verification
go build ./...+go test ./internal/service/... ./internal/handler/...passvue-tsc+vite buildpass; ccswitchImport unit tests cover no-mapping / full / partial/healthokNotes
GroupDTO (likeallow_messages_dispatch) — key holders need it to configure their client;model names are not credentials.
messages_dispatch_model_configfield.