bolder-ai
Python SDK for BEval Studio by Bolder — log LLM/VLM/agent calls to your observability & evaluation dashboard.
Distribution name is bolder-ai. Import name is beval.
- Fire-and-forget, non-blocking (background thread queue)
- Works with raw calls,
@tracedecorator, or auto-instrumented OpenAI / Anthropic clients - Zero hard deps beyond
httpx
Install
pip install bolder-ai
# optional integrations
pip install 'bolder-ai[openai]'
pip install 'bolder-ai[anthropic]'
Then import beval in your code.
Requires Python 3.9+.
Configure
Set environment variables (or pass to beval.init(...)):
| Env | Purpose |
|---|---|
BEVAL_API_KEY |
Your BEval project API key (required) |
BEVAL_API_URL |
Gateway base URL (default: https://ai-gateway.bolder.services) |
BEVAL_PROJECT_ID |
Optional project scoping |
BEVAL_DEFAULT_MODEL_ID |
Default model_id if not passed per-call |
BEVAL_DEBUG |
1 to enable debug logging |
Quick start
1. Raw log
import beval
beval.init() # reads env
beval.log(
kind="llm",
model_id="gpt-4o-mini",
input="What is the capital of France?",
output="Paris.",
latency_ms=312,
tokens_in=7,
tokens_out=2,
)
2. Auto-wrap OpenAI
import beval
from openai import OpenAI
beval.init()
client = beval.wrap(OpenAI())
client.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "Hi"}],
)
Automatically captures input messages, output, model, token counts, latency, errors. Detects image parts and logs as kind="vlm".
3. Auto-wrap Anthropic
import beval
from anthropic import Anthropic
beval.init()
client = beval.wrap(Anthropic())
client.messages.create(
model="claude-sonnet-4-6",
max_tokens=64,
messages=[{"role": "user", "content": "Hi"}],
)
4. @beval.trace decorator
Wrap any function (sync or async) as an agent log:
@beval.trace
def run_agent(query: str) -> str:
return ...
@beval.trace(name="tool:search", kind="agent")
async def search(q): ...
Captures args, return value, latency, and exceptions (logged with status="failure").
VLM / images
Pass image= to attach a base64 data URL (matches the dashboard's VLM preview):
beval.log(
kind="vlm",
model_id="gpt-4o",
input="describe this",
output="a cat",
image=open("cat.png", "rb").read(),
image_mime="image/png",
)
Redaction
Strip PII before send:
def redact(payload: dict) -> dict:
if payload.get("input"):
payload["input"] = scrub_pii(payload["input"])
return payload
beval.init(redact=redact)
Lifecycle
beval.flush(timeout=5.0)— wait for queued logs to drainbeval.shutdown()— drain + close (runs automatically at interpreter exit)
Reliability
- Non-blocking:
log()enqueues and returns immediately - Network failures never raise — they're logged via the
bevallogger - Drops on queue overflow (default capacity: 10,000)
- Retries transient errors (408/429/5xx) with exponential backoff
License
MIT
Release files for bolder-ai 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bolder_ai-0.1.1.tar.gz | 16.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bolder_ai-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 34.3 kB
Release files / bolder_ai-0.1.1.tar.gz
| Download URL | bolder_ai-0.1.1.tar.gz |
|---|---|
| Size | 16.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
19451fe9733f3dbac92cfa41f7332a4ae86761ce61067cb53fc930d5b8c65668
|
|
BLAKE2b-256 checksum How to use checksums |
1a520bb172a0ce66f075b683a026c3c45861df39768fe6b8b9dadbf39d33034e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.11
|
Release files / bolder_ai-0.1.1-py3-none-any.whl
| Download URL | bolder_ai-0.1.1-py3-none-any.whl |
|---|---|
| Size | 18.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4ce5449ab3ef4661e15ad579336b8f201530a38768f7bc86f4ec5ddb631a0265
|
|
BLAKE2b-256 checksum How to use checksums |
8ec57769f67777ed43bfc690851ad7e884945fec144a9fdf2d23875e87f848cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.11
|