# aimock

A single-package mock server for AI application testing that answers deterministically for LLM APIs, MCP, A2A, AG-UI, vector databases and search services on one local port, with record-and-replay of real API traffic.

aimock mocks everything an AI application talks to so a test suite can point its SDK at one local port and get deterministic answers with no API keys, no network access and no surprise bills: LLM APIs such as OpenAI, Claude, Gemini, Bedrock, Azure, Vertex AI, Ollama and Cohere, image generation and editing, text-to-speech, transcription, audio translation and generation, video generation, embeddings, MCP tools and resources with session management, the A2A agent-to-agent protocol with SSE streaming, AG-UI agent-to-UI event streams for frontend testing, vector database endpoints compatible with Pinecone, Qdrant and ChromaDB, and services such as Tavily search, Cohere rerank and OpenAI moderation.

Its record-and-replay feature proxies real APIs, saves the traffic as fixtures, and replays it deterministically forever; timing-aware fixtures capture per-frame arrival timestamps so replay approximately reproduces the original time-to-first-token and inter-frame cadence, with a configurable replay-speed multiplier.

It installs as a single npm package and runs the whole suite on one port with a config file, or composes exactly the mocks needed through a programmatic API.

Website: http://aimock.copilotkit.dev/
