Repository navigation
feat(operators): serve the Claude tiers through the Anthropic API in local development - #2017
Merged
Merged
Conversation
…local development ANTHROPIC_API_ENABLED with a key runs every Claude row on the Anthropic API instead of Bedrock, translating Converse blocks at the edge as the self-hosted route does. The registry refuses it outside dev and test. The anthropic SDK moves from the dev extra to the main dependencies.
Contributor
|
Change classification: normal — platform or application code changed. A normal change carries a documented automated review on this pull request before merge, in place of a second human approver. The |
Member
Author
|
@claude please review this PR |
|
Claude finished @jfrench9's task in 27s —— View job Review of #2017: Anthropic API provider for local developmentVerdict: looks good to merge. I found no blocking issues. The gating is tight and the adapter is clear. I read the diff of the source, config and dependency changes. I did not read
What I checked
Minor suggestions (non-blocking)
Things to confirm
|
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
A developer can now run the operators' Claude tiers on their own Anthropic API key instead of Bedrock. It is off by default and for local development only.
Changes
config/operators.py: a third provider,ANTHROPIC. WithANTHROPIC_API_ENABLEDon, every Claude row keeps its short name, request fields and rate-card key, and changes only its wire id (the short name itself) and provider. The registry refuses the flag whenENVIRONMENTis notdevortest, and refuses it without a key.config/env.py:ANTHROPIC_API_ENABLEDandANTHROPIC_API_KEY.operations/operators/anthropic_api.py(new): translates Converse blocks to the Messages API and back, covering tools, tool results, cache markers, effort and thinking blocks. Retries only refusals that precede a generation; a timeout is not re-sent.operations/operators/ai_client.py: routes a row served by the Anthropic API to the new client.pyproject.toml,uv.lock:anthropicmoves from thedevextra to the main dependencies, so it ships in the image. No version changed in the lock..env.example,docs/technical/Local-Development.md,config/README.md: describe the route.Worth a close look: the switch is all or nothing. With it on, every Claude row is served by the Anthropic API, and a Bedrock wire id passed literally no longer resolves.
Breaking Changes
None. With the flag off the registry is unchanged.
Testing
just test-all: 18,708 passed, 44 skipped, 2 xfailed; lint, format and type checks clean.Certification
🤖 Generated with Claude Code