LLM-mock – Record real LLM API responses once, replay them in tests forever
The article introduces llm-mock, a tool designed to record and replay LLM API calls for testing purposes. It allows developers to run tests without incurring costs or requiring API keys after the initial recording. The tool integrates seamlessly with pytest, enabling deterministic testing of LLM responses.
- ▪llm-mock allows recording real LLM responses and replaying them in tests without needing an API key.
- ▪The tool helps reduce costs associated with API calls during continuous integration runs.
- ▪It intercepts HTTP calls at the transport layer, requiring no changes to existing application code.
Opening excerpt (first ~120 words) tap to expand
llm-mock 0.1.1 pip install llm-mock Copy PIP instructions Latest version Released: May 21, 2026 Record and replay LLM API calls for deterministic testing Navigation Project description Release history Download files Verified details These details have been verified by PyPI Maintainers troman Unverified details These details have not been verified by PyPI Meta Requires: Python >=3.10 Provides-Extra: dev Report project as malware Project description Project details Release history Download files Project description llm-mock Record real LLM responses once, replay them in tests forever — no API key required, no cost, no non-determinism.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at Pypi.