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.2.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.2.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: litmus_python_sdk-0.2.0.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for litmus_python_sdk-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d41e6829b2e10eea3157cb017ca25e4e9044ed583219d1e99396fd342d8e5e1e
MD5 bd316c3791341421b758f18a568a6cb4
BLAKE2b-256 7093650810bcfaa44557ac521d887b49c4179e0c63207bea97674a90a562f5e4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: litmus_python_sdk-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for litmus_python_sdk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1380a4c373b00c3775c544e456ff73ac07ef429f24a6522ed39666207539f6bd
MD5 95746abcd8c7fc3954f3a6df0aede1d9
BLAKE2b-256 67e201b5e0fac39ab1fc5c2ad0ec644b425452c2cb225ec1f33600d6cff55f38

See more details on using hashes here.

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