fix(bedrock): correct max tokens for meta.llama3-70b-instruct-v1:0#33413
fix(bedrock): correct max tokens for meta.llama3-70b-instruct-v1:0#33413mngue wants to merge 1 commit into
Conversation
…ma3-70b-instruct-v1:0
max_output_tokens/max_tokens was listed as 8192 for most regions and the global entry, but meta.llama3-70b-instruct-v1:0 is hardcoded in litellm's BEDROCK_CONVERSE_MODELS, so it always routes through the Bedrock Converse API by default. Converse hard-rejects any max_tokens above 2048 for this model with a 400 ValidationException ("The maximum tokens you requested exceeds the model limit of 2048"), confirmed against a live us-east-1 endpoint.
The GovCloud entries already had max_output_tokens: 2048 but used max_input_tokens: 8000 instead of 8192, the context length confirmed by Bedrock's own error message ("This model's maximum context length is 8192 tokens").
Greptile SummaryThis PR fixes incorrect token limit metadata for
Confidence Score: 5/5Safe to merge — data-only corrections to two JSON files with no logic changes and no test regressions. Every affected entry for meta.llama3-70b-instruct-v1:0 has been identified and corrected, both JSON files are kept in sync, the author provided live-endpoint error messages confirming both the 2048 output cap and the 8192 input limit, and no existing tests assert the old (incorrect) values. No files require special attention.
|
| Filename | Overview |
|---|---|
| model_prices_and_context_window.json | Corrects max_output_tokens/max_tokens from 8192 to 2048 for all 7 non-GovCloud regional entries and the global meta.llama3-70b-instruct-v1:0 entry; corrects max_input_tokens from 8000 to 8192 for the two GovCloud entries. All 10 model entries for this model are accounted for and updated correctly. |
| litellm/model_prices_and_context_window_backup.json | Identical token-limit corrections applied to keep the backup in sync with model_prices_and_context_window.json; changes are byte-for-byte consistent between the two files. |
Reviews (1): Last reviewed commit: "fix(bedrock): correct max_input_tokens/m..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Relevant issues
Linear ticket
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
@greptileaito re-request a review after pushing changes)Screenshots / Proof of Fix
This is a static data fix to
model_prices_and_context_window.json.meta.llama3-70b-instruct-v1:0is listed in litellm'sBEDROCK_CONVERSE_MODELS, sobedrock/meta.llama3-70b-instruct-v1:0(no explicit route prefix) always routes through the Bedrock Converse API by default.A real request against a live
us-east-1endpoint withmax_tokensabove 2048, routed through Converse, returns:Before this fix, most regional entries (
ap-south-1,ca-central-1,eu-west-1,eu-west-2,sa-east-1,us-east-1,us-west-1) and the globalmeta.llama3-70b-instruct-v1:0entry listedmax_output_tokens: 8192/max_tokens: 8192, which is 4x the actual 2048 output cap enforced by the Converse route.Separately, the two GovCloud entries (
us-gov-east-1,us-gov-west-1) already had the correctmax_output_tokens: 2048, but listedmax_input_tokens: 8000instead of 8192. Requesting a prompt near the boundary against a liveus-east-1endpoint confirms the context length is 8192, not 8000:Before (on
main, example forus-east-1):After (this PR):
Note: the underlying Llama 3 70B model may accept a higher
max_gen_len(tested up to 4096) through Bedrock's native Invoke API. However, since this model is hardcoded to the Converse route in litellm and litellm's Llama Invoke transformation currently throws an unrelatedValidationExceptionfor this model, 2048 reflects the actual limit for the only reachable, working path today. The Invoke-route issue is a separate bug outside this PR's scope.Verified both
model_prices_and_context_window.jsonand the syncedlitellm/model_prices_and_context_window_backup.jsonremain valid JSON after the change:Type
🐛 Bug Fix
Changes
max_output_tokens/max_tokensformeta.llama3-70b-instruct-v1:0from8192to2048across all 7 non-GovCloud regional entries and the global entry, matching the Converse route's enforced output cap.max_input_tokensfor the two GovCloud entries (us-gov-east-1,us-gov-west-1) from8000to8192, matching the confirmed context length and the other regions.litellm/model_prices_and_context_window_backup.jsonto keep it in sync withmodel_prices_and_context_window.json.Final Attestation