Repository navigation
feat(pricing): add gemini-live-2.5-flash-native-audio to model cost map - #38564
Closed
mubashir1osmani wants to merge 4 commits into
Closed
mubashir1osmani wants to merge 4 commits into
mubashir1osmani wants to merge 4 commits into
Conversation
Missing entry caused a cascade: _model_cost_entry returned {} for
vertex_ai/gemini-live-2.5-flash-native-audio, so _is_audio_only_live_model
returned False, _coerce_response_modalities never coerced TEXT -> AUDIO in
the Vertex setup message, the session hung, and no usage was ever logged.
Add bare key (vertex_ai-language-models provider) and gemini/ prefixed key
(gemini provider) with GA pricing: $0.50/M text in, $3.00/M audio in,
$2.00/M text out, $12.00/M audio out, gemini_native_audio=true.
Also extend the existing parametrized tests to assert the vertex_ai/ prefix
resolves correctly through _model_cost_entry's stripped-prefix fallback.
…ex_ai/chirp-3, vertex_ai/veo-3.1-lite-generate-001
Contributor
Greptile SummaryThe PR adds Gemini Live 2.5 Flash native-audio pricing and capability metadata to the primary and backup model catalogs, adds realtime endpoint support, and extends Gemini realtime regression coverage.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| model_prices_and_context_window.json | Adds the Gemini Live native-audio provider entry and realtime endpoint metadata consistently with the intended request and spend behavior. |
| litellm/model_prices_and_context_window_backup.json | Mirrors the primary catalog changes for local and remote-fetch fallback runtime operation. |
| tests/test_litellm/llms/gemini/realtime/test_gemini_realtime_transformation.py | Extends native-audio detection and directly checks the primary catalog. |
Reviews (2): Last reviewed commit: "merge(staging): merge litellm_internal_s..." | Re-trigger Greptile
Resolved conflicts in both pricing JSON files (kept our /v1/realtime endpoint addition for vertex_ai entry, plus adopted upstream's supports_prompt_caching and search_context_cost_per_query additions). Also adopted upstream's transformation.py refactor (which dropped _is_native_audio_model), updated tests accordingly: removed the stale test for the now-absent method, added a catalog regression test that reads the JSON file directly instead of relying on the mocked fixture.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
Author
|
bugbot run |
Contributor
Author
Contributor
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit a5bef3f. Configure here.
This was referenced Aug 28, 2026
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TLDR
Problem this solves:
vertex_ai/gemini-live-2.5-flash-native-audiologged zero usage and $0 spend on every requestHow it solves it:
gemini-live-2.5-flash-native-audio(vertex_ai-language-models provider) andgemini/gemini-live-2.5-flash-native-audio(gemini provider) with GA pricing andgemini_native_audio: trueto both the primary and backup cost map files_model_cost_entryfallback (stripvertex_ai/prefix, look up bare key) now resolves the model correctlyUser Flow
Before: a proxy operator using
vertex_ai/gemini-live-2.5-flash-native-audiosees no usage loggedwss://proxy/v1/realtime?model=vertex_ai/gemini-live-2.5-flash-native-audiosession.updatewithmodalities: ["text"]responseModalities: ["TEXT"]to Vertex AI (native-audio model only supports AUDIO), session never completes a turnresponse.donenever arrives, usage field is null, spend logged as $0After: the same model produces a completed response with real usage
wss://proxy/v1/realtime?model=vertex_ai/gemini-live-2.5-flash-native-audiosession.updatewithmodalities: ["text"]responseModalities: ["AUDIO"]response.donearrives with non-zero audio token counts; spend is logged at the published rate ($3.00/M audio in, $12.00/M audio out)Relevant issues
Linear ticket
Pre-Submission checklist
uv run pytest tests/test_litellm/<your_test_file>.py -v. Leave the suites (make test-unit-*,make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more@greptileaito re-request a review after pushing changes)Screenshots / Proof of Fix
Proof requires a live proxy with this model deployed; connect below once it's available on the gateway.
Type
🐛 Bug Fix
Final Attestation
Note
Low Risk
Changes are limited to pricing JSON and test coverage; runtime behavior depends on existing cost-map lookup and modality coercion with no new code paths.
Overview
Registers gemini-live-2.5-flash-native-audio in the LiteLLM pricing catalog so realtime proxy sessions can resolve the model, bill audio tokens correctly, and treat it as native-audio-only when building Gemini Live setup messages.
The vertex catalog entry now lists
/v1/realtimealongside/vertex_ai/live, and a newgemini/gemini-live-2.5-flash-native-audioentry adds GA Gemini API pricing withgemini_native_audio: true. The same updates are mirrored in the backup JSON. Existing_model_cost_entrylookup (strip provider prefix → bare key) letsvertex_ai/gemini-live-2.5-flash-native-audiopick up that flag so_coerce_response_modalitiesrewrites clienttextmodalities toAUDIOinstead of forwarding invalidTEXTto Vertex.Tests extend the realtime transformation fixtures to cover the new model IDs and assert both catalog keys exist with
gemini_native_audioset.Reviewed by Cursor Bugbot for commit a5bef3f. Bugbot is set up for automated code reviews on this repo. Configure here.