Skip to main content

verdictlens (Python SDK)

Python client for VerdictLens — hierarchical tracing for AI agent workloads with auto-instrumentation.

See the repository root for the full platform quickstart.

Install

pip install verdictlens

Quickstart

from verdictlens import configure, trace, wrap_openai
from openai import OpenAI

configure(base_url="http://localhost:8000")
client = wrap_openai(OpenAI())

@trace(name="my_pipeline", span_type="chain")
def my_pipeline(query: str) -> str:
    context = retrieve(query)
    return generate(context, query)

@trace(name="retrieve", span_type="retrieval")
def retrieve(query: str) -> list:
    return vector_db.search(query)

@trace(name="generate", span_type="agent")
def generate(context: list, query: str) -> str:
    response = client.chat.completions.create(
        model="gpt-4o-mini",
        messages=[{"role": "user", "content": f"{context}\n{query}"}]
    )
    return response.choices[0].message.content

This produces a hierarchical span tree:

my_pipeline (chain)
├── retrieve (retrieval)
└── generate (agent)
    └── openai.chat.completions.create(gpt-4o-mini) (llm)  ← auto-traced

Key Features

  • Nested @trace — child spans auto-attach to parent via contextvars
  • wrap_openai(client) — auto-trace OpenAI chat completions with zero code
  • wrap_anthropic(client) — auto-trace Anthropic messages with zero code
  • wrap_google(client) — auto-trace Google Gemini generate_content with zero code
  • asyncio.gather safe — parallel branches maintain correct parent context
  • Non-blocking — async transport with disk-backed offline queue

Metadata

Release files for verdictlens 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for verdictlens 0.2.0
File Size Uploaded Provenance Actions
verdictlens-0.2.0.tar.gz 34.9 kB Without provenance Details for verdictlens-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for verdictlens 0.2.0
File Interpreter ABI Platform Actions
verdictlens-0.2.0-py3-none-any.whl Python 3 none any Details for verdictlens-0.2.0-py3-none-any.whl

Total release size: 81.2 kB

Release files / verdictlens-0.2.0.tar.gz

Download URL verdictlens-0.2.0.tar.gz
Size 34.9 kB
Tags Source
SHA-256 checksum
How to use checksums
630bc0d88d93284e18ff0896ce0564824b46ea9edd00861555fa681eb96c67a6
BLAKE2b-256 checksum
How to use checksums
f71968afee33d8fd9f19749efb43e45fba4062151bacfb7b27645d60ce7253e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / verdictlens-0.2.0-py3-none-any.whl

Download URL verdictlens-0.2.0-py3-none-any.whl
Size 46.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
35b0d25b0e60fcfb50e0b23839801e34c573b0030a47f63de7cf4280a7c869ea
BLAKE2b-256 checksum
How to use checksums
6e34390d9f268f88f157206362a077ad161fc7c6eaf39cf0b5ba1e8de6dcf8a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Security for verdictlens 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page