Python client for sending LLM traces to EvalWatch
Project description
evalwatch
Python client for sending LLM traces to EvalWatch — a SaaS observability and evaluation platform for LLM products.
Install
pip install evalwatch
Quick start
Get an API key from your EvalWatch dashboard (/settings), then instrument your LLM calls:
from evalwatch import EvalWatchClient
client = EvalWatchClient("https://your-evalwatch-instance.com", api_key="sk-...")
# 1. Manual
client.send_trace(
prompt="What is the capital of France?",
response="Paris.",
latency_ms=120,
model_name="gpt-4o",
provider="openai",
token_usage=30,
)
# 2. Context manager — measures latency automatically
with client.capture(prompt="...", model_name="gpt-4o", provider="openai") as trace:
response = openai_client.chat.completions.create(...)
trace.finish(response=response.choices[0].message.content, token_usage=response.usage.total_tokens)
# 3. Decorator — wraps any function whose first arg is the prompt
@client.watch(model_name="gpt-4o", provider="openai")
def call_llm(prompt: str) -> str:
return openai_client.complete(prompt)
All three methods send traces to POST /api/v1/observe/traces and are visible in the Traces dashboard immediately.
License
MIT
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 evalwatch-0.1.0.tar.gz.
File metadata
- Download URL: evalwatch-0.1.0.tar.gz
- Upload date:
- Size: 14.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a246428948fa5d1259119e1acca69c8f5d4220af96462007d9b9f4f6a914f33
|
|
| MD5 |
3abeb0b06787b68a6a1d982b6d0ac712
|
|
| BLAKE2b-256 |
5fd4c4f53e0a7ba6c52db30801c1335a385afa244acb4a97b1d058d3f50b6ace
|
File details
Details for the file evalwatch-0.1.0-py3-none-any.whl.
File metadata
- Download URL: evalwatch-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b65bbf1d2f7d497bd4631cb5b86be182880b4077b83e47ef077bce0f3ed17d4
|
|
| MD5 |
0f6063def7bd83d7566cb67a50cc2600
|
|
| BLAKE2b-256 |
8fa3495511c50bbbf94933c09acd9b0796a4ea5fdb41f99149d351496deb06f7
|