CopilotKit/aimock
Mock everything your AI app talks to — LLM APIs, MCP, A2A, AG-UI, vector DBs, search. One package, one port, zero dependencies.
What it solves
Testing AI applications is often expensive, slow, and non-deterministic due to reliance on live LLM APIs and other AI services. aimock provides a comprehensive mock infrastructure that allows developers to simulate these services locally, eliminating the need for real API keys, network calls, and the costs associated with live production APIs during testing.
How it works
aimock acts as a local server that mimics the API surfaces of numerous AI providers. By changing the BASE_URL of an AI SDK (like OpenAI's) to point to the aimock server, the application sends requests to the mock instead of the real provider. It uses "fixtures"—predefined request-response pairs—to return deterministic results. It also features a record-and-replay mode where it can proxy real API calls and save them as fixtures for future deterministic replay.
Who it’s for
Developers building AI agents, LLM-powered applications, and multimodal AI tools who need a reliable, fast, and cost-effective way to run unit and end-to-end tests without hitting live production endpoints.
Highlights
- Broad Provider Support: Mocks 13 providers across 15 API surfaces, including OpenAI, Claude, Gemini, Bedrock, Azure, Vertex AI, and Ollama.
- Multimodal Capabilities: Supports mocking for image generation (DALL-E, Imagen), text-to-speech, audio transcription, and video generation.
- Protocol Mocking: Beyond LLMs, it mocks MCP tools, A2A (Agent-to-Agent) protocols, AG-UI event streams, and vector databases (Pinecone, Qdrant, ChromaDB).
- Deterministic Testing: Includes record-and-replay functionality with timing-aware reproduction and multi-turn conversation matching.
- Chaos Testing: Ability to simulate 500 errors, malformed JSON, and mid-stream disconnects to test application resilience.
- Scaling & Integration: Provides Docker/Helm charts for CI/CD, Vitest/Jest plugins, and a GitHub Action for seamless integration into testing pipelines.