LiteLLM AI Gateway
1. Prerequisites
pip install opentelemetry-api opentelemetry-sdk opentelemetry-exporter-otlp
2. Configuration: Enabling the OTel Callback
Option A: LiteLLM Proxy (config.yaml)
config.yaml)model_list:
- model_name: gpt-4o
litellm_params:
model: openai/gpt-4o
api_key: "os.environ/OPENAI_API_KEY"
litellm_settings:
callbacks: ["otel"] # Enables OTel spans and metricsOption B: Python Environment Variables
3. Advanced: Capturing Full Prompts & Responses
4. Setting Up the Pipeline in Apica Flow
5. Troubleshooting
SQL query to visualize the Latency vs. Token Count
1. Latency vs. Token Count Scatter Plot
2. Efficiency Metric: "Tokens per Second" (TPS)
3. "Costly Latency" Heatmap
4. How to add these to your Apica Dashboard
Pro-Tip: Detecting "Runaway Agents"
Last updated
Was this helpful?