glia v0.6.0 — record/replay cassettes
Record/replay cassettes — VCR for the LLM protocol.
Record a real provider's responses to a readable JSON cassette once, then replay them deterministically with no network and no API key:
from glia import Agent, use_cassette
from glia.providers import ClaudeLLM
# First run records (needs a key); later runs replay offline — identical output.
llm = use_cassette("tests/cassettes/weather.json", ClaudeLLM)
agent = Agent(llm, tools=[get_weather])RecordingLLM/ReplayLLM(request-key match + ordered fallback;strict=Truefor exact). Streaming both directions.use_cassetterecords if the cassette is missing, replays if it exists.
159 offline tests, ~95% coverage, ruff + mypy + tests green. Example: 09_record_replay.py.
Install/upgrade: pip install -U glia-agents