mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-10 22:41:41 +00:00
docs: add documentation for logfire integration
This commit is contained in:
parent
978912ef32
commit
7e0b479a37
2 changed files with 60 additions and 0 deletions
60
docs/my-website/docs/observability/logfire_integration.md
Normal file
60
docs/my-website/docs/observability/logfire_integration.md
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
import Image from '@theme/IdealImage';
|
||||
|
||||
# Logfire - Logging LLM Input/Output
|
||||
|
||||
Logfire is open Source Observability & Analytics for LLM Apps
|
||||
Detailed production traces and a granular view on quality, cost and latency
|
||||
|
||||
<Image img={require('../../img/logfire.png')} />
|
||||
|
||||
:::info
|
||||
We want to learn how we can make the callbacks better! Meet the LiteLLM [founders](https://calendly.com/d/4mp-gd3-k5k/berriai-1-1-onboarding-litellm-hosted-version) or
|
||||
join our [discord](https://discord.gg/wuPM9dRgDw)
|
||||
:::
|
||||
|
||||
## Pre-Requisites
|
||||
|
||||
Ensure you have run `pip install logfire` for this integration
|
||||
|
||||
```shell
|
||||
pip install logfire litellm
|
||||
```
|
||||
|
||||
## Quick Start
|
||||
|
||||
Get your Logfire token from [Logfire](https://logfire.pydantic.dev/)
|
||||
|
||||
```python
|
||||
litellm.success_callback = ["logfire"]
|
||||
litellm.failure_callback = ["logfire"] # logs errors to logfire
|
||||
```
|
||||
|
||||
```python
|
||||
# pip install logfire
|
||||
import litellm
|
||||
import os
|
||||
|
||||
# from https://logfire.pydantic.dev/
|
||||
os.environ["LOGFIRE_TOKEN"] = ""
|
||||
|
||||
# LLM API Keys
|
||||
os.environ['OPENAI_API_KEY']=""
|
||||
|
||||
# set logfire as a callback, litellm will send the data to logfire
|
||||
litellm.success_callback = ["logfire"]
|
||||
|
||||
# openai call
|
||||
response = litellm.completion(
|
||||
model="gpt-3.5-turbo",
|
||||
messages=[
|
||||
{"role": "user", "content": "Hi 👋 - i'm openai"}
|
||||
]
|
||||
)
|
||||
```
|
||||
|
||||
## Support & Talk to Founders
|
||||
|
||||
- [Schedule Demo 👋](https://calendly.com/d/4mp-gd3-k5k/berriai-1-1-onboarding-litellm-hosted-version)
|
||||
- [Community Discord 💭](https://discord.gg/wuPM9dRgDw)
|
||||
- Our numbers 📞 +1 (770) 8783-106 / +1 (412) 618-6238
|
||||
- Our emails ✉️ ishaan@berri.ai / krrish@berri.ai
|
||||
BIN
docs/my-website/img/logfire.png
Normal file
BIN
docs/my-website/img/logfire.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 695 KiB |
Loading…
Add table
Reference in a new issue