Skip to content

glia v0.6.0 — record/replay cassettes

Choose a tag to compare

@DenisDrobyshev DenisDrobyshev released this 23 Jul 07:32
· 10 commits to master since this release

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=True for exact). Streaming both directions.
  • use_cassette records 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