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
Merge branch 'litellm_internal_staging' into litellm_lit_7022_azure_ai_passthrough_config
mateo-berria6681950e817
diff --cc litellm/router.pyindex 5117d33a520,b4f48fa9496..a20f010c608--- a/litellm/router.py+++ b/litellm/router.py@@@ -98,7 -98,7 +98,8 @@@ from litellm.litellm_core_utils.sensitimask_credentials_in_payload,mask_sensitive_structure,)+ from litellm.litellm_core_utils.token_counter import offload_token_count+from litellm.llms.base_llm.passthrough.transformation import replace_path_segmentfrom litellm.llms.base_llm.vector_store.transformation import (RouterVectorStoreEmbeddingExecutor,vector_store_request_metadata,diff --cc tests/test_litellm/litellm_core_utils/test_token_counter.pyindex 1898fd57220,7da04d12569..60f25c48443--- a/tests/test_litellm/litellm_core_utils/test_token_counter.py+++ b/tests/test_litellm/litellm_core_utils/test_token_counter.py@@@ -1,11 -1,15 +1,16 @@@#### What this tests ##### This tests litellm.token_counter.token_counter() function+ import asyncio+import base64import importlib+ import threadingimport timeimport traceback+ from concurrent.futures import Future, wait+ from typing import Finalfrom unittest.mock import MagicMock+ import anyio.to_threadimport pytestimport tiktoken@@@ -15,10 -19,13 +20,15 @@@ import litellfrom litellm import create_pretrained_tokenizer, decode, encode, get_modified_max_tokensfrom litellm import token_counter as token_counter_oldimport litellm.constants+ from litellm.constants import TOKEN_COUNTER_MAX_CONCURRENT_COUNTS+ from litellm.litellm_core_utils.asyncify import asyncifyfrom litellm.litellm_core_utils.token_counter import (+ _get_exact_count_function,+ _get_extrapolating_count_function,_get_tiktoken_count_function,+ calculate_img_tokens,+ high_detail_image_token_upper_bound,+ offload_token_count,)from litellm.litellm_core_utils.token_counter import token_counter as token_counter_newfrom tests.large_text import text