The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
chore: merge litellm_cost_shard_provider_wires into litellm_cost_shard_proxy_behaviour
kerry94b88429287b
diff --cc tests/integration/cost_calculation/cost_tracking_cases.jsonindex 78d00f28381,bb909de2e06..63b47dcba14--- a/tests/integration/cost_calculation/cost_tracking_cases.json+++ b/tests/integration/cost_calculation/cost_tracking_cases.json@@@ -618,10 -618,97 +618,102 @@@"input_cost_per_token": 1.51e-06,"output_cost_per_token": 7.51e-06},+ "text-embedding-3-large": {+ "litellm_provider": "openai",+ "mode": "embedding",+ "input_cost_per_token": 1.3e-07++ },+ "text-embedding-4-small": {+ "input_cost_per_token": 1.01e-06,+ "output_cost_per_token": 0,+ "litellm_provider": "openai",+ "mode": "embedding"+ },+ "text-embedding-3-large-next": {+ "input_cost_per_token": 1.02e-06,+ "output_cost_per_token": 0,+ "litellm_provider": "openai",+ "mode": "embedding"+ },+ "azure/text-embedding-4-large": {+ "input_cost_per_token": 1.03e-06,+ "output_cost_per_token": 0,+ "litellm_provider": "azure",+ "mode": "embedding"+ },+ "embed-v5": {+ "input_cost_per_token": 1.04e-06,+ "output_cost_per_token": 0,+ "litellm_provider": "cohere",+ "mode": "embedding"+ },+ "amazon.titan-embed-text-v2:0": {+ "input_cost_per_token": 1.05e-06,+ "output_cost_per_token": 0,+ "litellm_provider": "bedrock",+ "mode": "embedding"+ },+ "cohere.embed-english-v4": {+ "input_cost_per_token": 1.06e-06,+ "output_cost_per_token": 0,+ "litellm_provider": "bedrock",+ "mode": "embedding"+ },+ "text-embedding-006": {+ "input_cost_per_token": 1.07e-06,+ "output_cost_per_token": 0,+ "litellm_provider": "vertex_ai-embedding-models",+ "mode": "embedding"+ },+ "gemini/gemini-embedding-002": {+ "input_cost_per_token": 1.08e-06,+ "output_cost_per_token": 0,+ "litellm_provider": "gemini",+ "mode": "embedding"+ },+ "together_ai/together-embed-v1": {+ "input_cost_per_token": 1.09e-06,+ "output_cost_per_token": 0,+ "litellm_provider": "together_ai",+ "mode": "embedding"+ },+ "fireworks_ai/fireworks-embed-v1": {+ "input_cost_per_token": 1.1e-06,+ "output_cost_per_token": 0,+ "litellm_provider": "fireworks_ai",+ "mode": "embedding"+ },+ "rerank-v4": {+ "input_cost_per_token": 1.11e-06,+ "output_cost_per_token": 0,+ "input_cost_per_query": 0.0021,+ "litellm_provider": "cohere",+ "mode": "rerank"+ },+ "cohere.rerank-v4:0": {+ "input_cost_per_token": 1.12e-06,+ "output_cost_per_token": 0,+ "input_cost_per_query": 0.0022,+ "litellm_provider": "bedrock",+ "mode": "rerank"+ },+ "gpt-3.5-turbo-instruct-next": {+ "input_cost_per_token": 1.14e-06,+ "output_cost_per_token": 2.14e-06,+ "litellm_provider": "text-completion-openai",+ "mode": "completion"+ },+ "omni-moderation-next": {+ "input_cost_per_token": null,+ "output_cost_per_token": 0,+ "litellm_provider": "openai",+ "mode": "moderation"+ },+ "together_ai/meta-llama/Llama-3.3-70B-Instruct-Turbo": {+ "input_cost_per_token": 1.16e-06,+ "output_cost_per_token": 2.16e-06,+ "litellm_provider": "together_ai",+ "mode": "completion"}},"cases": [diff --cc tests/integration/cost_calculation/test_cost_tracking.pyindex f2057067c67,182ba218046..d646278efff--- a/tests/integration/cost_calculation/test_cost_tracking.py+++ b/tests/integration/cost_calculation/test_cost_tracking.py@@@ -3,15 -3,12 +3,15 @@@from __future__ import annotationsimport io- from itertools import isliceimport json- from hashlib import sha256import struct+import time- from typing import Final, cast+import uuidimport waveimport zlib+ from hashlib import sha256++from itertools import islice+ from typing import Final, castimport httpximport pytest