LoongSuite LiteLLM instrumentation
Project description
This library provides automatic instrumentation for the LiteLLM library, which provides a unified interface to 100+ LLM providers.
Installation
git clone https://github.com/alibaba/loongsuite-python-agent.git cd loongsuite-python-agent pip install ./instrumentation-loongsuite/loongsuite-instrumentation-litellm
Configuration
The instrumentation can be enabled/disabled using environment variables:
ENABLE_LITELLM_INSTRUMENTOR: Enable/disable instrumentation (default: true)
Usage
from opentelemetry.instrumentation.litellm import LiteLLMInstrumentor
import litellm
# Instrument LiteLLM
LiteLLMInstrumentor().instrument()
# Use LiteLLM as normal
response = litellm.completion(
model="gpt-3.5-turbo",
messages=[{"role": "user", "content": "Hello!"}]
)
Features
This instrumentation automatically captures:
LLM completion calls (sync and async)
Streaming completions
Embedding calls
Retry mechanisms
Tool/function calls
Request and response metadata
Token usage
Model information
The instrumentation follows OpenTelemetry semantic conventions for GenAI operations.
References
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file loongsuite_instrumentation_litellm-0.5.0-py3-none-any.whl.
File metadata
- Download URL: loongsuite_instrumentation_litellm-0.5.0-py3-none-any.whl
- Upload date:
- Size: 16.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d073af1ee1f9cdafdee1a648402bd5284eccb4f3ac7b8ef7ec3440983445db5
|
|
| MD5 |
85137634d2ec77cb84419809a76f66c0
|
|
| BLAKE2b-256 |
87a887775ccebc79805108d4c5b32151e4dc165736896f47d9355ff6d4fd6630
|