Litmus Python SDK - implicit evals for AI products
Project description
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.
Project details
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 litmus_python_sdk-0.4.0.tar.gz.
File metadata
- Download URL: litmus_python_sdk-0.4.0.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b45c9d0e7ecb90b1c0eb7194e856227b96013438016d1e164087c921993f6294
|
|
| MD5 |
b9ba1b92821a40bdc9cb963014911fa1
|
|
| BLAKE2b-256 |
a3d2860535a7a1c299e26200c1479a65755ecd2edcd7acb901e21e8e2451443e
|
Provenance
The following attestation bundles were made for litmus_python_sdk-0.4.0.tar.gz:
Publisher:
publish.yml on trylitmus/litmus-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
litmus_python_sdk-0.4.0.tar.gz -
Subject digest:
b45c9d0e7ecb90b1c0eb7194e856227b96013438016d1e164087c921993f6294 - Sigstore transparency entry: 1247178301
- Sigstore integration time:
-
Permalink:
trylitmus/litmus-python@0962bb31d060c599c45ca066de6101eee2ee8dc5 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/trylitmus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0962bb31d060c599c45ca066de6101eee2ee8dc5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file litmus_python_sdk-0.4.0-py3-none-any.whl.
File metadata
- Download URL: litmus_python_sdk-0.4.0-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a394ee7ddb1b014a31875301fae2142448ee0e618d6bca18e9a711743a4f082
|
|
| MD5 |
f4ad7eb88f2941fcb07e110275f2ea3a
|
|
| BLAKE2b-256 |
ed61e6643db1a76d18a5d09b15aebf86e3245be45ecc0a404131bfcc4b1a9d0c
|
Provenance
The following attestation bundles were made for litmus_python_sdk-0.4.0-py3-none-any.whl:
Publisher:
publish.yml on trylitmus/litmus-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
litmus_python_sdk-0.4.0-py3-none-any.whl -
Subject digest:
4a394ee7ddb1b014a31875301fae2142448ee0e618d6bca18e9a711743a4f082 - Sigstore transparency entry: 1247178306
- Sigstore integration time:
-
Permalink:
trylitmus/litmus-python@0962bb31d060c599c45ca066de6101eee2ee8dc5 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/trylitmus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0962bb31d060c599c45ca066de6101eee2ee8dc5 -
Trigger Event:
push
-
Statement type: