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.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.

cassette_sdk-0.1.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cassette_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 7.1 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.0.tar.gz
Algorithm Hash digest
SHA256 80d280789eb3407fc3fe8a1ed1dea9b5bf3df5b3a04749e9f3410adf11652597
MD5 5d8a15b41dfc9fd179384ddebfbfb4e4
BLAKE2b-256 6a5a2f86394dd8f7d4d3f1230b7d7de27eb61decaf026f1bee3e30cdb57fb2ef

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cassette_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.8 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fccc526d16bd08bd6cbaa07c6169caf653d098bde181dcc1433514074f24f60f
MD5 42368aa6bd822cb5c663dc8b44c6c0a3
BLAKE2b-256 f69804f75e9c654c4e42ee57243e0d070c19a1d379fe32b7208ae62c28e66204

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