Skip to content

fix(bedrock_mantle): correct GPT-5.6 context window to 1M tokens - #36299

Closed
xyos wants to merge 1 commit into
BerriAI:litellm_internal_stagingfrom
xyos:fix/bedrock-mantle-gpt-5-6-context-window
Closed

xyos wants to merge 1 commit into
BerriAI:litellm_internal_stagingfrom
xyos:fix/bedrock-mantle-gpt-5-6-context-window

Conversation

@xyos

@xyos xyos commented Aug 8, 2026

Copy link
Copy Markdown

Title

fix(bedrock_mantle): correct GPT-5.6 context window to 1M tokens

Relevant issues

None filed — found while using bedrock_mantle GPT-5.6 models behind the proxy.

Pre-Submission checklist

  • I have Added testing in the tests/litellm/ directory
  • I have added a screenshot/output of my test passing (below)
  • Keep scope isolated — data fix + tests only

Type

🐛 Bug Fix

Changes

GPT-5.6 Sol, Terra, and Luna support 1M-token context windows on Amazon Bedrock, announced 2026-08-03.

The bedrock_mantle/openai.gpt-5.6-* entries still carried the pre-launch 272000, while the azure/gpt-5.6-* entries in the same cost map already read 1050000 — which is what suggested this was an oversight rather than intentional.

Since max_input_tokens is what clients use to budget context, the stale value causes premature context-window errors and early auto-compaction on a model that accepts ~4x more input.

  "bedrock_mantle/openai.gpt-5.6-sol": {
-     "max_input_tokens": 272000,
+     "max_input_tokens": 1050000,

…and the same for -terra and -luna (plus the mirrored model_prices_and_context_window_backup.json).

Verification against the live endpoint

bedrock-mantle us-east-2, Responses API. An oversized prompt makes the service report its own cap:

openai.gpt-5.6-sol    -> prompt tokens (1300007) exceed model maximum (1050000)
openai.gpt-5.6-terra  -> prompt tokens (1300007) exceed model maximum (1050000)
openai.gpt-5.6-luna   -> prompt tokens (1300007) exceed model maximum (1050000)

A real 832,877-token request then completed successfully (HTTP 200, 15s), correctly retrieving a fact planted at 85% depth — so the window is usable, not just accepted.

Scoped to 5.6 on purpose

openai.gpt-5.5 and openai.gpt-5.4 report a 278528 cap from the same endpoint, so I left them at their current value even though their azure/* counterparts read 1050000:

openai.gpt-5.5  -> prompt tokens (1300007) exceed model maximum (278528)
openai.gpt-5.4  -> prompt tokens (1300007) exceed model maximum (278528)

Added test_gpt_5_5_and_5_4_keep_shorter_context_window to pin that distinction, so the long-context values don't get widened to every openai.gpt-5.x entry later.

I did not change 5.5/5.4 to 278528 here to keep this PR to one problem — happy to file that separately.

Tests

New tests in tests/test_litellm/llms/bedrock_mantle/test_bedrock_mantle_transformation.py, and updated the existing TestBedrockMantleResponsesPricing assertion that pinned the old value.

$ pytest tests/test_litellm/llms/bedrock_mantle/ \
         tests/test_litellm/test_gpt_5_4_model_metadata.py \
         tests/test_litellm/test_model_prices_schema.py -q
236 passed in 4.52s

The new tests fail without the data change (confirming they're meaningful):

$ git stash -- model_prices_and_context_window.json ...backup.json
$ pytest -k long_context -q
FAILED test_gpt_5_6_long_context_window[openai.gpt-5.6-sol]   - assert 272000 == 1050000
FAILED test_gpt_5_6_long_context_window[openai.gpt-5.6-terra] - assert 272000 == 1050000
FAILED test_gpt_5_6_long_context_window[openai.gpt-5.6-luna]  - assert 272000 == 1050000

ruff and black are clean on the lines this PR touches.

Note on ci_cd/check_files_match.py

Both JSON files are updated identically. Note that check already fails on a clean litellm_internal_staging checkout — the backup has unrelated drift (zai/glm-5.1, openrouter/z-ai/glm-5.1, darkbloom/*). I deliberately did not sync those to keep this diff to 6 data lines; happy to include the full sync if you'd prefer.

@CLAassistant

CLAassistant commented Aug 8, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@greptile-apps

greptile-apps Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Updates the Bedrock Mantle GPT-5.6 Sol, Terra, and Luna metadata to advertise a 1,050,000-token input limit

  • Keeps the canonical and bundled backup model maps aligned
  • Updates the existing pricing assertion and adds regression coverage for GPT-5.6 and the unchanged GPT-5.4/5.5 limits

Confidence Score: 4/5

The metadata correction appears safe to merge after removing the newly added source-code comment

The model-map values, lookup behavior, bundled backup, and regression coverage are consistent; only a non-blocking repository convention violation remains

Files Needing Attention: tests/test_litellm/llms/bedrock_mantle/test_bedrock_mantle_responses_transformation.py

Important Files Changed

Filename Overview
model_prices_and_context_window.json Updates the canonical max_input_tokens metadata consistently for all three Bedrock Mantle GPT-5.6 variants
litellm/model_prices_and_context_window_backup.json Mirrors the canonical GPT-5.6 context-window changes in the bundled local model map
tests/test_litellm/llms/bedrock_mantle/test_bedrock_mantle_responses_transformation.py Correctly updates the parametrized metadata assertion, but introduces a source comment prohibited by repository conventions
tests/test_litellm/llms/bedrock_mantle/test_bedrock_mantle_transformation.py Adds offline, provider-scoped regression coverage for all changed GPT-5.6 entries and preserves shorter limits for GPT-5.4 and GPT-5.5

Reviews (1): Last reviewed commit: "fix(bedrock_mantle): correct GPT-5.6 con..." | Re-trigger Greptile

@codecov

codecov Bot commented Aug 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

GPT-5.6 Sol, Terra, and Luna support 1M-token context windows on Amazon
Bedrock, announced 2026-08-03:
https://aws.amazon.com/about-aws/whats-new/2026/08/gpt-sol-terra-luna-long-context-bedrock/

The bedrock_mantle entries still carried the pre-launch 272000, while the
azure/gpt-5.6-* entries in the same cost map already read 1050000. Because
max_input_tokens is what clients use to budget context, the stale value
causes premature context-window errors and early auto-compaction on a
model that accepts ~4x more input.

Verified against the live endpoint (bedrock-mantle us-east-2, Responses
API). An oversized prompt reports the real cap:

  openai.gpt-5.6-sol    -> prompt tokens (1300007) exceed model maximum (1050000)
  openai.gpt-5.6-terra  -> prompt tokens (1300007) exceed model maximum (1050000)
  openai.gpt-5.6-luna   -> prompt tokens (1300007) exceed model maximum (1050000)

and a real 832877-token request completed successfully, correctly
retrieving a fact planted at 85% depth.

Scoped to 5.6 deliberately: openai.gpt-5.5 and openai.gpt-5.4 report a
278528 cap from the same endpoint, so they are left at their current value
even though their azure/* counterparts read 1050000. Added a regression
test pinning that distinction so the long-context values are not widened
to every openai.gpt-5.x entry.

Also updates the existing TestBedrockMantleResponsesPricing assertion,
which pinned the old 272000.
@xyos
xyos force-pushed the fix/bedrock-mantle-gpt-5-6-context-window branch from 0379875 to 3b001a7 Compare August 8, 2026 21:07
@xyos

xyos commented Aug 8, 2026

Copy link
Copy Markdown
Author

Good catch, removed both comment lines. The test docstrings are kept since CONTRIBUTING.md asks for them. Tests still pass.

@codspeed

codspeed Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing xyos:fix/bedrock-mantle-gpt-5-6-context-window (3b001a7) with litellm_internal_staging (97a59c8)

Open in CodSpeed

@mateo-berri

Copy link
Copy Markdown
Contributor

Superseded: #38225 already raised the gpt-5.6 sol, terra, and luna entries to 1,050,000 with long-context tier pricing, so this change is on staging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants