AI Agent Observability — trace, evaluate, and debug LLM and voice AI agents in production.
Project description
Preval Python SDK
AI Agent Observability for production LLM and voice agents.
Preval traces, evaluates, and debugs your AI agents in production. Drop the SDK into your code and get a full waterfall view of every call, every span, every token — with cost, latency, and quality scores per request.
Install
pip install preval
For framework integrations, install an extra:
pip install preval[openai]
pip install preval[langchain]
pip install preval[crewai]
pip install preval[livekit]
pip install preval[vapi]
pip install preval[deepgram]
pip install preval[opentelemetry] # auto-instrument 20+ providers
Or install everything at once:
pip install preval[all]
Quickstart
import preval
p = preval.init(
api_key="your-api-key",
project="my-project",
)
p.init_opentelemetry()
# All OpenAI / Anthropic / LangChain calls are now auto-traced
from openai import OpenAI
client = OpenAI()
response = client.chat.completions.create(
model="gpt-4.1",
messages=[{"role": "user", "content": "Hello!"}],
)
That's it. Open your dashboard at https://preval.dev and you'll see the trace within seconds.
Manual tracing
If you want full control over span boundaries:
from preval import PrevalObserve
observe = PrevalObserve(api_key="your-api-key", project="my-project")
with observe.trace("call-123", modality="voice", agent_name="support-bot") as t:
with t.span("transcribe", type="stt", provider="deepgram") as s:
s.set_output("Hello, how can I help?", confidence=0.95)
with t.span("generate", type="llm", provider="openai", model="gpt-4o") as s:
s.set_output("I can help you with that.")
s.set_tokens(input=120, output=45)
observe.shutdown()
Integrations
| Framework | Install | Usage |
|---|---|---|
| OpenAI | pip install preval[openai] |
p.instrument_openai() |
| OpenAI Assistants | pip install preval[openai-assistants] |
p.wrap_openai_assistants(client) |
| LangChain | pip install preval[langchain] |
handler = p.langchain_handler() |
| CrewAI | pip install preval[crewai] |
from preval.integrations.crewai_wrapper import instrument_crew |
| LiveKit | pip install preval[livekit] |
from preval.integrations.livekit import PrevalLiveKitPlugin |
| Vapi | pip install preval[vapi] |
from preval.integrations.vapi import VapiWebhookHandler |
| Deepgram | pip install preval[deepgram] |
p.instrument_deepgram() |
| OpenTelemetry | pip install preval[opentelemetry] |
p.init_opentelemetry() (auto-instruments 20+ providers) |
Links
- Dashboard: https://preval.dev
- Documentation: https://docs.preval.dev
- Issues: https://github.com/preval-dev/preval-python-sdk/issues
- Changelog: https://github.com/preval-dev/preval-python-sdk/blob/main/CHANGELOG.md
License
MIT — see the LICENSE file for details.
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 Distribution
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 preval-0.1.0a1.tar.gz.
File metadata
- Download URL: preval-0.1.0a1.tar.gz
- Upload date:
- Size: 25.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e756e6f5cc4fd4c763019e81e1282be0800444f5879652bcb50af0140088d72
|
|
| MD5 |
df25d574dda1a2001a044b871a8991ff
|
|
| BLAKE2b-256 |
e7a213a5d75e3167891aa79c08b88419a8ea936dd3d891c7de7bd534a76e0544
|
File details
Details for the file preval-0.1.0a1-py3-none-any.whl.
File metadata
- Download URL: preval-0.1.0a1-py3-none-any.whl
- Upload date:
- Size: 32.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
883e3065a3b363511d6432b1decc8868e2ede7668d28357f1764af8004b2e875
|
|
| MD5 |
5f60343694da3d9ca22656c4ac529dba
|
|
| BLAKE2b-256 |
c133fe18213986b1e8509e66950aadeb12e64d3fc911dcfac972536725207b3a
|