Skip to content

fix(vertex_ai): correct gemma-4-26b-a4b-it-maas context window to 262144 - #31747

Closed
mateo-berri wants to merge 1 commit into
litellm_internal_stagingfrom
litellm_gemma-4-26b-maas-context-window-6ea5
Closed

mateo-berri wants to merge 1 commit into
litellm_internal_stagingfrom
litellm_gemma-4-26b-maas-context-window-6ea5

Conversation

@mateo-berri

Copy link
Copy Markdown
Contributor

Relevant issues

Linear ticket

Resolves LIT-4117

Pre-Submission checklist

  • I have added meaningful tests
  • My PR passes all CI/CD checks (e.g., lint, format, unit tests)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have requested a Greptile review by commenting @greptileai and received a Confidence Score of at least 4/5 before requesting a maintainer review

Context

The Vertex AI MaaS model vertex_ai/google/gemma-4-26b-a4b-it-maas is already wired up and working: it lives in the cost map, routes through the OpenAI-compatible partner-models path via the google/gemma- prefix, and is covered by tests. The one inaccuracy was its context window

The cost map carried max_input_tokens: 256000, a rounded approximation. Google's official Vertex AI model card lists the context length as 262,144 tokens (256K) with a 128,000 max output. Sibling Vertex MaaS entries such as vertex_ai/openai/gpt-oss-120b-maas already set max_input_tokens to the full context window, so this aligns gemma-4 with both the model card and the existing convention. The undercount silently truncated callers that gate on get_model_info, rejecting valid 256K-token prompts

Changes

Set max_input_tokens to 262144 for vertex_ai/google/gemma-4-26b-a4b-it-maas in both model_prices_and_context_window.json and the packaged litellm/model_prices_and_context_window_backup.json. Added a regression test that loads the local cost map and asserts the entry matches the model card (context window, max output, input/output cost, function-calling and vision flags), which fails on the old 256000 value

Type

🐛 Bug Fix

Screenshots / Proof of Fix

No GCP credentials are available in this environment, so a live Gemma inference call against Vertex was not possible. Since this is a cost-map metadata correction, the end-user-visible surface is the model info the proxy reports. Ran a live proxy with the local cost map and queried it

$ export LITELLM_LOCAL_MODEL_COST_MAP=True
$ python litellm/proxy/proxy_cli.py --config config.yaml --port 4000
# config.yaml model: vertex_ai/google/gemma-4-26b-a4b-it-maas

$ curl -s http://localhost:4000/v1/model/info -H "Authorization: Bearer sk-1234"
{
  "model_name": "gemma-4-26b",
  "litellm_model": "vertex_ai/google/gemma-4-26b-a4b-it-maas",
  "max_input_tokens": 262144,
  "max_output_tokens": 128000,
  "input_cost_per_token": 1.5e-07,
  "output_cost_per_token": 6e-07,
  "supports_vision": true,
  "supports_function_calling": true
}

Before the fix the same endpoint returned "max_input_tokens": 256000

Slack Thread

Open in Web Open in Cursor 

Google's Vertex AI model card for gemma-4-26b-a4b-it-maas lists a 262,144
token context window, but the cost map carried a rounded 256000. Align
max_input_tokens with the official spec and the full-context-window
convention used by sibling Vertex MaaS entries, and add a regression test
that loads the local cost map and guards the entry against the model card.

Co-authored-by: Mateo Wang <mateo-berri@users.noreply.github.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@codspeed

codspeed Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 30 untouched benchmarks


Comparing litellm_gemma-4-26b-maas-context-window-6ea5 (279e4fe) with litellm_internal_staging (be4d0d8)

Open in CodSpeed

@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Superseded by rolling registry audit #37902, which reverified and absorbed the provider-documented metadata changes at field level

@devin-ai-integration
devin-ai-integration Bot deleted the litellm_gemma-4-26b-maas-context-window-6ea5 branch September 10, 2026 03:41
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