Skip to content

language_models: Add Anthropic-compatible provider support in settings - #50381

Merged
anantdgoel merged 13 commits into
zed-industries:mainfrom
cppcoffee:anthropic_compatible
Jun 12, 2026
Merged

language_models: Add Anthropic-compatible provider support in settings#50381
anantdgoel merged 13 commits into
zed-industries:mainfrom
cppcoffee:anthropic_compatible

Conversation

@cppcoffee

@cppcoffee cppcoffee commented Feb 28, 2026

Copy link
Copy Markdown
Contributor

Release Notes:

  • Added Anthropic-compatible provider support in settings
  1. add anthropic-compatible provider via menu
2026-02-28.17.50.22.mov
  1. use anthropic-compatible
2026-02-28.17.53.34.mov

Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Feb 28, 2026
@SomeoneToIgnore SomeoneToIgnore added the area:ai Related to Agent Panel, Edit Prediction, Copilot, or other AI features label Feb 28, 2026
@anantdgoel anantdgoel self-assigned this Jun 10, 2026
@cla-bot

cla-bot Bot commented Jun 10, 2026

Copy link
Copy Markdown

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Anant Goel.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@cla-bot cla-bot Bot removed the cla-signed The user has signed the Contributor License Agreement label Jun 10, 2026
- 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
anantdgoel force-pushed the anthropic_compatible branch from f5b401c to 42f01ac Compare June 10, 2026 04:43
@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Jun 10, 2026
anantdgoel and others added 6 commits June 11, 2026 08:39
- 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
@anantdgoel

anantdgoel commented Jun 12, 2026

Copy link
Copy Markdown
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
anantdgoel enabled auto-merge June 12, 2026 02:59
@anantdgoel
anantdgoel added this pull request to the merge queue Jun 12, 2026
Merged via the queue into zed-industries:main with commit fef979d Jun 12, 2026
32 checks passed
@anantdgoel anantdgoel mentioned this pull request Jun 17, 2026
5 tasks
This was referenced Jun 18, 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ai Related to Agent Panel, Edit Prediction, Copilot, or other AI features cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants