Skip to main content

One-call shim to route LLM SDK traffic through the Cassette record/replay gateway

Project description

cassette-sdk

Record/replay LLM & agent API calls so your tests run fast, free, and deterministic.

The first time your tests run, Cassette records each LLM response to a local file. After that it replays the saved response — no network, no API key, no token cost, and no random failures from the model wording things differently.

Install

pip install cassette-sdk

Use (in-process, no gateway)

from cassette.recorder import http_client
from openai import OpenAI

client = OpenAI(http_client=http_client(project="demo"))  # records → replays locally

Modes via CASSETTE_MODE: record | replay | auto (default). Cassettes are plain JSON in ./.cassettes and diff cleanly in PRs.

Detect real regressions

from cassette.drift import compare_cassette_files
result = compare_cassette_files("baseline.json", "new.json")
print(result.verdict)  # identical | benign | regression

It ignores harmless rewording but flags changed tool calls, structured-output shape changes, and truncation as regressions.

Free and open source (MIT). Team features (shared registry + GitHub PR merge-gate) at cassette.dev.

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

cassette_sdk-0.1.1.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

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

cassette_sdk-0.1.1-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file cassette_sdk-0.1.1.tar.gz.

File metadata

  • Download URL: cassette_sdk-0.1.1.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for cassette_sdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 223610c612e2705148c4a04e8cd6fae9dc9903dc69a0a443571ef7304c6ee576
MD5 bcfedc84cea853e2dcf83377d78094d1
BLAKE2b-256 c60eee261f0be9a5971c9e831bf4624eedcda04bb90193c840298fba16f0aadc

See more details on using hashes here.

File details

Details for the file cassette_sdk-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: cassette_sdk-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for cassette_sdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6f764f6bcf3b35d9ffd355104dc7028e6677f546edf56a1867336fd2b2ab43b2
MD5 e32d3b081e44b71c6ea99133957af3f4
BLAKE2b-256 2d72cc0b184ab39c076a852b8f220dcd5f7e6b916edb58c0f8610fe101ea5f48

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