Getting Started
- Introduction
- Self Host
Integrations
- LLM & Inference Providers
- Frameworks & Libraries
- Tools Logging
- Any Vector DB
Prompt Engineering
- Experiments
- Datasets & Fine-Tuning
- Prompts
- Scores
- User Feedback
- Webhooks
References
- Async Logging
- Cost Calculation
- Data Security & Privacy
- Generic Gateway
- Header Directory
- Latency
- Open Source
- Proxy vs Async
- Reliability
LiteLLM
LiteLLM Integration with OpenLLmetry
Easily log your LiteLLM API calls to Helicone using OpenLLmetry.
Overview
Helicone’s OpenLLmetry integration allows you to log your LiteLLM API calls to Helicone without modifying your code.
1
Install Helicone Async
Copy
Ask AI
pip install helicone-async
2
Initialize Logger
Copy
Ask AI
from helicone_async import HeliconeAsyncLogger
from openai import OpenAI
from litellm import completion
logger = HeliconeAsyncLogger(
api_key=HELICONE_API_KEY,
)
logger.init()
client = OpenAI(api_key=OPENAI_API_KEY)
#openai call
response = completion(
model="gpt-3.5-turbo",
messages=[{"role": "user", "content": "Hi 👋 - i'm openai"}],
metadata={
"Helicone-Property-Hello": "World"
}
)
#cohere call
response = completion(
model="command-r",
messages=[{"role": "user", "content": "Hi 👋 - i'm cohere"}],
metadata={
"Helicone-Property-Hello": "World"
}
)
print(response.choices[0])
1
Install Helicone Async
Copy
Ask AI
pip install helicone-async
2
Initialize Logger
Copy
Ask AI
from helicone_async import HeliconeAsyncLogger
from openai import OpenAI
from litellm import completion
logger = HeliconeAsyncLogger(
api_key=HELICONE_API_KEY,
)
logger.init()
client = OpenAI(api_key=OPENAI_API_KEY)
#openai call
response = completion(
model="gpt-3.5-turbo",
messages=[{"role": "user", "content": "Hi 👋 - i'm openai"}],
metadata={
"Helicone-Property-Hello": "World"
}
)
#cohere call
response = completion(
model="command-r",
messages=[{"role": "user", "content": "Hi 👋 - i'm cohere"}],
metadata={
"Helicone-Property-Hello": "World"
}
)
print(response.choices[0])
Read more about OpenLLmetry
Was this page helpful?
On this page
Assistant
Responses are generated using AI and may contain mistakes.