Skip to main content

llm-trace-sampler-py

Sample LLM traces by risk, errors, latency, and deterministic ids. Pure Python, zero deps. Python port of @mukundakatta/llm-trace-sampler.

pip install llm-trace-sampler-py
from llm_trace_sampler import should_sample_trace, sample_traces

# Always sample errors / high-risk / slow traces; sample 10% of the rest.
should_sample_trace({"id": "abc", "error": "boom"})
# SampleDecision(sample=True, reason='priority')

sampled = sample_traces(my_traces, rate=0.1, risk_threshold=0.7, latency_ms=10_000)

Deterministic by trace id — the same id is always sampled / not sampled.

License

MIT

Metadata

Release files for llm-trace-sampler-py 0.1.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 llm-trace-sampler-py 0.1.0
File Size Uploaded Provenance Actions
llm_trace_sampler_py-0.1.0.tar.gz 3.3 kB Without provenance Details for llm_trace_sampler_py-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for llm-trace-sampler-py 0.1.0
File Interpreter ABI Platform Actions
llm_trace_sampler_py-0.1.0-py3-none-any.whl Python 3 none any Details for llm_trace_sampler_py-0.1.0-py3-none-any.whl

Total release size: 6.7 kB

Release files / llm_trace_sampler_py-0.1.0.tar.gz

Download URL llm_trace_sampler_py-0.1.0.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
acf7d2dd926a4897da7290994cb4ac7113c367a8935506e16edf2a31f5ba1d49
BLAKE2b-256 checksum
How to use checksums
0c8753a62532ca63bb32277ba68cd2a3242ad832cd18f1f94b566ad37126bf9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release files / llm_trace_sampler_py-0.1.0-py3-none-any.whl

Download URL llm_trace_sampler_py-0.1.0-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6c906f717b9b00ce176dde6bb00ef13b8f45aaa58fad84ba82b25e72cf61b5e8
BLAKE2b-256 checksum
How to use checksums
dd1bc33a09ea453c7297fd7a177359442062cd12e303ebbcef3d492487215515
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Security for llm-trace-sampler-py 0.1.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.1.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