Model override using ANTHROPIC_MODEL is not working.
Status Fixed / completed
Maintainer reply ✓ Yes — bcherny
Activity 8 comments · opened Feb 27, 2025 · closed Feb 27, 2025
💡 Likely answer: A maintainer (bcherny, collaborator)
responded on this thread — see the highlighted reply below.
Exported ANTHROPIC_MODEL to Haiku 3.5
printenv results in
ANTHROPIC_MODEL=anthropic.claude-3-5-haiku-20241022-v1:0
DISABLE_PROMPT_CACHING=1
AWS_REGION=us-east-1
CLAUDE_CODE_USE_BEDROCK=1
However, in AWS CW Bedrocks metrics, it is still using Sonnet 3.7.
Even upon asking which model are you using
It response
I'm using claude-3-7-sonnet-20250219-v1:0.
8 Comments
Model overrides are not supported. Curious why you want to use a different model — is it mostly about cost?
@bcherny I'm personally interested to use Claude Code in a restricted environment (AWS GovCloud US West). Per this link we currently have access to 3.5 Sonnet / 3 Haiku.
It sounds like overriding will _not_ be supported, any guess on if / when 3.7 Sonnet + 3.5 Haiku will be rolled out to more AWS Bedrock regions?
Override is not supported??
This link says it is?
https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/overview#use-with-third-party-apis
@bcherny - I would love to use 3.5 - for many cases it is _good enough_ at a much less cost.
Cost, speed. Moreover the documentation says to use that param to override the model.
Just adding to the discussion, using Sonnet with the loose/freedom that Claude Code gives us is pretty much good enough for a lot of quicker tasks, which could improve costs a lot
I contacted AWS, and they won't increase my Claude 3.7 Sonnet quota in the short term, so I want to use 3.5. The documentation also says it's possible to replace the model, but why isn't it working?
``
Optional: Override the default model (Claude 3.7 Sonnet is used by default):``This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.