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
Fix load credentials in token counter proxy
eycjurb4512cb1e753
diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.pyindex 52f42c9f310..472aeb140cf 100644--- a/litellm/proxy/proxy_server.py+++ b/litellm/proxy/proxy_server.py@@ -35,6 +35,7 @@ from litellm.constants import (LITELLM_SETTINGS_SAFE_DB_OVERRIDES,)from litellm.litellm_core_utils.safe_json_dumps import safe_dumps+from litellm.utils import load_credentials_from_listfrom litellm.types.utils import (ModelResponse,ModelResponseStream,@@ -5894,6 +5895,7 @@ async def token_counter(request: TokenCountRequest, call_endpoint: bool = False)passif deployment is not None:litellm_model_name = deployment.get("litellm_params", {}).get("model")+ load_credentials_from_list(deployment.get("litellm_params", {}))# remove the custom_llm_provider_prefix in the litellm_model_nameif "/" in litellm_model_name:litellm_model_name = litellm_model_name.split("/", 1)[1]