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
Added typed dict for LangfuseUsageDetails
Fabricio Ceschind47ad69a1b2d
diff --git a/litellm/integrations/langfuse/langfuse.py b/litellm/integrations/langfuse/langfuse.pyindex f4d1a1f79c4..17e15e0b03c 100644--- a/litellm/integrations/langfuse/langfuse.py+++ b/litellm/integrations/langfuse/langfuse.py@@ -659,7 +659,7 @@ class LangFuseLogger:"completion_tokens": _usage_obj.completion_tokens,"total_cost": cost if self._supports_costs() else None,}- usage_details = {+ usage_details : Optional[LangfuseUsageDetails] = {"input": _usage_obj.prompt_tokens,"output": _usage_obj.completion_tokens,"cache_creation_input_tokens": _usage_obj.get('cache_creation_input_tokens', 0),diff --git a/litellm/types/integrations/langfuse.py b/litellm/types/integrations/langfuse.pyindex ecf42d8cd47..c19cd98d162 100644--- a/litellm/types/integrations/langfuse.py+++ b/litellm/types/integrations/langfuse.py@@ -5,3 +5,10 @@ class LangfuseLoggingConfig(TypedDict):langfuse_secret: Optional[str]langfuse_public_key: Optional[str]langfuse_host: Optional[str]+++class LangfuseUsageDetails(TypedDict):+ input: Optional[int]+ output: Optional[int]+ cache_creation_input_tokens: Optional[int]+ cache_read_input_tokens: Optional[int]