language_models: Add Anthropic-compatible provider support in settings - #50381
Merged
Conversation
Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
|
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Anant Goel.
|
- Centralize and unify handling of compatibility providers - Add CompatibleProviderSettings, CompatibleProviderKind, and reconcile_compatible_providers to compute desired providers - Use built-in provider ids to avoid conflicts and log warnings - Replace ad-hoc registration with a single reconciliation step
- Add AiAnthropicCompat icon variant and asset - Refactor Anthropic/OpenAI compatible providers to fetch settings via a global resolver - Update language model error handling to unify HttpResponseError - Clarify API key sourcing in docs (keychain storage and env vars)
anantdgoel
force-pushed
the
anthropic_compatible
branch
from
June 10, 2026 04:43
f5b401c to
42f01ac
Compare
- Move model name uniqueness check to use model_names and all_unique - Add custom_headers for Anthropic and propagate to requests - Distinguish OpenAI vs Anthropic providers when syncing - Remove cache_configuration from Anthropic models
…le settings The registry has a single provider ID namespace, but the same name could be configured in both the openai_compatible and anthropic_compatible settings sections. Which provider won was dependent on registration order, and removing one of the colliding entries left the removed provider registered. Track compatible providers as a map from ID to provider kind, resolving collisions deterministically in favor of the OpenAI-compatible entry (which predates Anthropic-compatible support) with a warning logged for the shadowed entry. Diffing over (id, kind) pairs makes kind changes unregister and re-register the provider correctly.
Deleting a compatible provider from Agent Settings removed its name from both the openai_compatible and anthropic_compatible settings sections, silently destroying a second configuration that happened to share the name. Remove only the entry that is actually registered, mirroring the OpenAI-wins precedence used at registration time; a shadowed anthropic_compatible entry takes over instead of being deleted.
- Name the API key placeholder strings as constants and use the Anthropic-style sk-ant- prefix for the Anthropic-compatible provider - Make parse_u64_field a free function since it never used self - Use fill="black" in the Anthropic compat icon for consistency with the OpenAI compat icon (icons are tinted at render time, so the source fill is cosmetic) - Restore the blank line in provider.rs to avoid diff churn
Contributor
|
Thank you for putting up this change! I cleaned up some of the code because the anthropic specific code had moved folders since you opened this PR, and I added some tests + a new logo. |
anantdgoel
enabled auto-merge
June 12, 2026 02:59
8 tasks
5 tasks
This was referenced Jun 18, 2026
Closed
This was referenced Jul 1, 2026
This was referenced Jul 10, 2026
jonx
pushed a commit
to jonx/zed-aros
that referenced
this pull request
Jul 17, 2026
zed-industries#50381) Release Notes: - Added Anthropic-compatible provider support in settings 1. add anthropic-compatible provider via menu https://github.com/user-attachments/assets/14b33d59-ae08-4215-b05f-9f3896a4a6f2 2. use anthropic-compatible https://github.com/user-attachments/assets/8bc7f1c5-644e-4528-942e-29150c35fed0 --------- Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com> Co-authored-by: Anant Goel <anant@zed.dev> Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
jolutz
pushed a commit
to jolutz/zed
that referenced
this pull request
Aug 8, 2026
zed-industries#50381) Release Notes: - Added Anthropic-compatible provider support in settings 1. add anthropic-compatible provider via menu https://github.com/user-attachments/assets/14b33d59-ae08-4215-b05f-9f3896a4a6f2 2. use anthropic-compatible https://github.com/user-attachments/assets/8bc7f1c5-644e-4528-942e-29150c35fed0 --------- Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com> Co-authored-by: Anant Goel <anant@zed.dev> Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
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.
Release Notes:
2026-02-28.17.50.22.mov
2026-02-28.17.53.34.mov