Practical Notes
- Mocks many surfaces from one port (LLM APIs, MCP, A2A, vector/search/rerank, etc.)
- Supports 12 LLM providers (per project docs) and streaming behaviors for realistic tests
- GitHub stars/forks (verified): see Source & Thanks
AIMock pays for itself the first time you avoid a flaky test or a surprise token bill.
Use it in three steps:
- Start
llmock(fixtures-first) or the full suite via--config. - Point your SDK to the mock by setting
OPENAI_BASE_URL(and a dummy key if the SDK requires it). - Record real traces once (optional), then replay deterministically in CI forever.
Two good guardrails:
- Keep fixtures in version control and review them like code.
- Add a CI check that fails if your tests accidentally talk to real endpoints (base URL not patched).
FAQ
Q: What does it mock? A: LLM APIs plus agent protocols like MCP/A2A and common infra like vector DBs, search, and rerank.
Q: Can it record real responses? A: Yes — it supports record & replay so you can capture and replay fixtures deterministically.
Q: How do I adopt it safely? A: Patch base URLs via env vars in tests and add a CI guard to prevent real endpoint calls.