Skip to content

feat(vertex-ai): add Grok 4.3 pricing metadata - #35728

Closed
woojung3 wants to merge 2 commits into
BerriAI:litellm_internal_stagingfrom
woojung3:feat_vertex_grok_4_3_pricing
Closed

woojung3 wants to merge 2 commits into
BerriAI:litellm_internal_stagingfrom
woojung3:feat_vertex_grok_4_3_pricing

Conversation

@woojung3

@woojung3 woojung3 commented Aug 4, 2026 •

Copy link
Copy Markdown

TLDR

Problem this solves:

  • Vertex AI does not recognize Grok 4.3 metadata
  • Built-in cost tracking misses its context pricing tiers

How it solves it:

  • Adds Google Cloud model metadata and pricing
  • Tests the 200K boundary and bundled map parity

Relevant issues

Linear ticket

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • 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 received a Greptile Confidence Score of at least 4/5 before requesting a maintainer review (Greptile reviews automatically once the PR is opened; only comment @greptileai to re-request a review after pushing changes)

Delays in PR merge?

If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review)

Screenshots / Proof of Fix

Google Cloud publishes the following Grok 4.3 rates:

Input context Input / 1M Output / 1M Cache hit / 1M
<= 200K $1.25 $2.50 $0.20
> 200K $2.50 $5.00 $0.40

Sources:

The model reference lists a 200,000-token context limit while the pricing page also publishes rates above 200K. This entry preserves the documented model limit and both published pricing tiers

Checks run on 3928ca69a4:

7 passed in 0.40s  tests/test_litellm/test_xai_grok_4_3_model_metadata.py
model_prices_and_context_window.schema.json validates
make pre-commit passes

Type

New Feature
Test

Changes

Adds vertex_ai/xai/grok-4.3 to the primary and bundled model maps with Google Cloud pricing, global availability, context limits, and documented capabilities

Extends the existing Grok 4.3 metadata tests to cover both Vertex AI model maps and short- versus long-context cost calculation at the 200K boundary

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR

@greptile-apps

greptile-apps Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds Vertex AI metadata for Grok 4.3 so model discovery and cost tracking recognize its 200K context boundary and published pricing tiers.

  • Registers identical pricing, limits, regions, and capability metadata in the primary and packaged fallback maps.
  • Adds coverage for model routing, map contents, and lower- versus upper-tier token costs.

Confidence Score: 4/5

The PR appears safe to merge, with a non-blocking test gap around the production Vertex AI cost-routing path.

The added metadata is synchronized and its tier boundary matches the documented rates, but the new pricing test directly invokes the generic helper and therefore cannot detect provider-routing or runtime lookup regressions.

Files Needing Attention: tests/test_litellm/test_xai_grok_4_3_model_metadata.py

Important Files Changed

Filename Overview
model_prices_and_context_window.json Adds the canonical Vertex AI Grok 4.3 metadata with consistent per-token pricing and a strict above-200K tier.
litellm/model_prices_and_context_window_backup.json Mirrors the canonical Grok 4.3 entry in the packaged fallback pricing map.
tests/test_litellm/test_xai_grok_4_3_model_metadata.py Verifies both maps and pricing boundaries, but the pricing test bypasses the production Vertex cost-routing and real lookup path.

Reviews (1): Last reviewed commit: "feat(vertex-ai): add Grok 4.3 pricing me..." | Re-trigger Greptile

@codecov

codecov Bot commented Aug 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@codspeed

codspeed Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing woojung3:feat_vertex_grok_4_3_pricing (3928ca6) with litellm_internal_staging (ba1bde7)1

Open in CodSpeed

Footnotes

  1. No successful run was found on litellm_internal_staging (d4d0bf0) during the generation of this report, so ba1bde7 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@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

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.

1 participant