Snapshot Testing for LLM Applications
Stop wasting time and money on slow, flaky LLM integration tests. Record your API responses once into 📼 **cassettes**, and replay them locally in milliseconds.
# Sequa Snapshot Cassette Testing
from langchain_groq import ChatGroq
from sequa import cassette
model = ChatGroq(model_name="llama-3.1-8b-instant")
# Automatically intercepts, records or replays
with cassette("tests/cassettes"):
response = model.invoke("Write a 3-word slogan for gravity.")
🟢⏱️ First run: 2.3 seconds (Recorded to cassette)
🚀⏱️ Second run: 12 ms (Replayed locally!)
See the Record & Replay Cycle
Interactive visualization showing what happens on the first run (recording network responses) versus subsequent runs (instant replaying).
Replay vs. Network Comparison
Powerful Command Line Diagnostics
Sequa is not just an API decorator; it comes packaged with CLI diagnostics to easily format, search, and list your cache files. Check stats or inspect content right from the command prompt.
📼 Sequa Cassette Analytics:
---------------------------------------
Location: tests/cassettes/
Total Cassettes: 14
Total Interactions: 87
API Providers: anthropic (4), groq (10)
Cache Hits Replayed: 1,429 times
Total Time Saved: 41.6 minutes 🚀
Estimated Cost Saved: $12.84 USD 💵
