litmus-python-sdk
Python SDK for Litmus — implicit evals for AI products.
Install
pip install litmus-python-sdk
Quick start
from litmus import LitmusClient
client = LitmusClient(api_key="ltm_pk_live_...")
# Track a generation and user signals
gen = client.generation("session-123", prompt_id="content_gen")
gen.event("$accept")
gen.event("$edit", edit_distance=0.3)
gen.event("$share", channel="slack")
# Custom events work too
gen.event("my_custom_signal", score=0.9)
# Flush before exit (serverless, scripts, etc.)
client.shutdown()
How it works
Events are queued in memory and shipped to the Litmus ingest API on a background thread. Batches are sent every 0.5s or when 100 events accumulate (both configurable). The consumer retries transient failures with exponential backoff.
For serverless environments, pass sync_mode=True to send inline.
All system events ($accept, $edit, $copy, etc.) get full autocomplete
via the EventType type. Custom event strings are accepted too.
Metadata
Release files for litmus-python-sdk 0.5.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| litmus_python_sdk-0.5.2.tar.gz | 9.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| litmus_python_sdk-0.5.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.9 kB
Release files / litmus_python_sdk-0.5.2.tar.gz
| Download URL | litmus_python_sdk-0.5.2.tar.gz |
|---|---|
| Size | 9.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
684d725600ab3e045e761192a2133f37cccaf15761ed2e1110a2f12d6031ffd3
|
|
BLAKE2b-256 checksum How to use checksums |
f8c0e6e5b87b1bc94bcfa9bfd9a5f926ce0e9ca6c8015b4a784b06b688b94f06
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 17, 2026.
Transparency logRelease files / litmus_python_sdk-0.5.2-py3-none-any.whl
| Download URL | litmus_python_sdk-0.5.2-py3-none-any.whl |
|---|---|
| Size | 12.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e2242ce8f736ce142a9c1349f4e21c1c985115390efc77b050a7c953cdc89a26
|
|
BLAKE2b-256 checksum How to use checksums |
054d69e872c126b2a12442246df6e70fc4fb0486a160651001058c49c5cad5ce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 17, 2026.
Transparency log