Skip to main content
LiteLLM provides a unified interface for calling 100+ LLMs using the OpenAI format. HoneyHive integrates with LiteLLM via the OpenInference instrumentor, automatically capturing all completion calls, token usage, and model metadata across providers.

Quick Start

Add HoneyHive tracing in just 4 lines of code. Add this to your existing LiteLLM app and all completion calls are automatically traced, regardless of the underlying provider.
To see where to initialize the tracer for your environment, including AWS Lambda and long-running servers, see Tracer Initialization.
Last tested with litellm 1.82.4 (March 2026).

What Gets Traced

The instrumentor automatically captures:
  • Completions - litellm.completion() and litellm.acompletion() with inputs, outputs, and token usage
  • Embeddings - litellm.embedding() and litellm.aembedding() requests
  • Image generation - litellm.image_generation() and litellm.aimage_generation() calls
  • Multi-provider routing - Model name and provider metadata for every call
No manual instrumentation required.
Use module-level calls. The instrumentor patches litellm.completion(), not directly imported functions. Always use litellm.completion() instead of from litellm import completion.

Example: Multi-Provider Completions


Avoiding Duplicate Spans

Avoid duplicate spans. If you also use provider-specific instrumentors (e.g., OpenAIInstrumentor), LiteLLM calls to that provider may produce duplicate spans. Use only the LiteLLM instrumentor when routing calls through LiteLLM.

Environment Configuration


Troubleshooting

Traces not appearing

  1. Check environment variables - Ensure HH_API_KEY is set
  2. Pass the tracer provider - The instrumentor must receive tracer_provider=tracer.provider:
  1. Use module-level calls - Call litellm.completion(), not a directly imported completion() function

Enrich Your Traces

Add user IDs and custom metadata to traces

Custom Spans

Create spans for business logic around API calls

Distributed Tracing

Trace calls across service boundaries

Resources