Skip to main content

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

litmus_python_sdk-0.3.0.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

litmus_python_sdk-0.3.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file litmus_python_sdk-0.3.0.tar.gz.

File metadata

  • Download URL: litmus_python_sdk-0.3.0.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for litmus_python_sdk-0.3.0.tar.gz
Algorithm Hash digest
SHA256 9151f6e12c7d29ccf4aaeff05edcbc58605ebcc3b9c10376e4b965af45a4c02c
MD5 26dc97c3e0a00cf664de40fe5700affb
BLAKE2b-256 e403176a72b46c8f9ffbf9807343ef18a37b2b1a9a90b77035529216b803c516

See more details on using hashes here.

Provenance

The following attestation bundles were made for litmus_python_sdk-0.3.0.tar.gz:

Publisher: publish-sdk.yml on JasonLovesDoggo/litmus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file litmus_python_sdk-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for litmus_python_sdk-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 10ab67a312f3d9cc7edfbe734fd6abbcd51fc4412f877bacb667ff9cd5e3c7b8
MD5 f8d08c5fdb1d3cb52fd8c0658db3121f
BLAKE2b-256 dcdff7a2d76dd84053e5299f4f8803b194c3d475a504c2a1e005b2852232a68b

See more details on using hashes here.

Provenance

The following attestation bundles were made for litmus_python_sdk-0.3.0-py3-none-any.whl:

Publisher: publish-sdk.yml on JasonLovesDoggo/litmus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page