litellm-mirror/litellm/llms/vertex_ai
Krish Dholakia 9c083e7d2c Support Gemini audio token cost tracking + fix openai audio input token cost tracking (#9535)
* fix(vertex_and_google_ai_studio_gemini.py): log gemini audio tokens in usage object

enables accurate cost tracking

* refactor(vertex_ai/cost_calculator.py): refactor 128k+ token cost calculation to only run if model info has it

Google has moved away from this for gemini-2.0 models

* refactor(vertex_ai/cost_calculator.py): migrate to usage object for more flexible data passthrough

* fix(llm_cost_calc/utils.py): support audio token cost tracking in generic cost per token

enables vertex ai cost tracking to work with audio tokens

* fix(llm_cost_calc/utils.py): default to total prompt tokens if text tokens field not set

* refactor(llm_cost_calc/utils.py): move openai cost tracking to generic cost per token

more consistent behaviour across providers

* test: add unit test for gemini audio token cost calculation

* ci: bump ci config

* test: fix test
2025-03-26 17:26:25 -07:00
..
batches Litellm dev 03 04 2025 p3 (#8997) 2025-03-04 21:58:03 -08:00
context_caching LiteLLM Minor Fixes & Improvements (12/23/2024) - p3 (#7394) 2024-12-23 22:02:52 -08:00
files vertex ai anthropic thinking param support (#8853) 2025-02-26 21:37:18 -08:00
fine_tuning vertex ai anthropic thinking param support (#8853) 2025-02-26 21:37:18 -08:00
gemini Support Gemini audio token cost tracking + fix openai audio input token cost tracking (#9535) 2025-03-26 17:26:25 -07:00
gemini_embeddings (code quality) run ruff rule to ban unused imports (#7313) 2024-12-19 12:33:42 -08:00
image_generation Support litellm.api_base for vertex_ai + gemini/ across completion, embedding, image_generation (#9516) 2025-03-25 23:46:20 -07:00
multimodal_embeddings fix vertex ai multimodal embedding translation (#9471) 2025-03-24 23:23:28 -07:00
text_to_speech vertex ai anthropic thinking param support (#8853) 2025-02-26 21:37:18 -08:00
vertex_ai_partner_models vertex ai anthropic thinking param support (#8853) 2025-02-26 21:37:18 -08:00
vertex_embeddings Support litellm.api_base for vertex_ai + gemini/ across completion, embedding, image_generation (#9516) 2025-03-25 23:46:20 -07:00
vertex_model_garden Litellm dev 2024 12 19 p3 (#7322) 2024-12-20 13:30:16 -08:00
common_utils.py rename _is_model_gemini_spec_model 2025-03-26 14:28:26 -07:00
cost_calculator.py Support Gemini audio token cost tracking + fix openai audio input token cost tracking (#9535) 2025-03-26 17:26:25 -07:00
vertex_ai_non_gemini.py Litellm dev 01 06 2025 p2 (#7597) 2025-01-06 21:04:49 -08:00
vertex_llm_base.py vertex ai anthropic thinking param support (#8853) 2025-02-26 21:37:18 -08:00