aimock: Deterministic Mock Infra for AI Apps

By Eli Berman
August 14, 2026
aimock: Deterministic Mock Infra for AI Apps

aimock crosses 1M weekly installs!

Here's what it does and what's new

If you've been building AI apps, you've probably hit the same wall: your test suite runs against real LLM endpoints, so every CI run burns tokens, every provider hiccup breaks your build, and every dev on your team needs API keys just to run npm test.

aimock is our fix for that.

It's an open-source mock server for every AI service your app talks to — LLMs, MCP tools, agentic protocols, vector databases, image models, TTS. You write a JSON fixture, point your API URL at localhost, and your tests run offline in milliseconds. Zero tokens, zero flake, deterministic every run.

It just crossed 1M weekly installs with 700+ GitHub stars, and it's quietly powering the test suites at OpenClaw, TanStack, Mastra, and the AG-UI protocol.

The 3-line setup

1. fixture.json
   { "fixtures": [
       { "match":    { "userMessage": "Hello" },
         "response": { "content": "Hi!" } }
   ] }

2. $ npx --yes --package=@copilotkit/aimock llmock -f fixture.json

3. $ export OPENAI_BASE_URL=http://localhost:4010

Nothing in your app or SDK changes. Your existing tests just stop making real API calls.

If you want to dive deeper, check out this aimock tutorial and setup guide.

What you can mock

Out of the box, aimock ships fixtures for:

  • LLMs — OpenAI, Claude, Gemini, Bedrock, Azure, Vertex AI, Ollama, Cohere, OpenRouter
  • Protocols — MCP, A2A, AG-UI
  • Vector DBs — Pinecone, Qdrant, ChromaDB
  • Multimedia — image generation, TTS, transcription, video generation
  • Services — Tavily search, Cohere rerank, OpenAI moderation, ElevenLabs

What's new

Recent releases have focused on making aimock behave less like a stub and more like a real test harness:

  • Record & Replay — capture live API traffic once in development, replay it forever in CI. Your test suite becomes a bit-exact snapshot of what production actually returns.
  • Drift Detection — LLM providers silently change response shapes. aimock catches those changes within 24 hours, so your CI fails before your users do.
  • Chaos Testing — inject latency, timeouts, and error responses on demand. Prove your app handles the messy paths real providers actually produce.
  • First-class MCP + A2A support — mock agentic protocols with the same fixture syntax you'd use for a chat completion.

Getting started

MIT-licensed, open source, from the team at CopilotKit. If you're testing anything that talks to an LLM, aimock belongs in your CI.

Want to bring CopilotKit into your stack? Talk to our engineers and we'll help you set it up.

Follow CopilotKit on Twitter for updates. If you get stuck, reach out in the CopilotKit or AG-UI communities.

Top posts

See All
Bring ChatGPT's Intelligent UI to your app with A2UI 1.0 and CopilotKit
Anmol Baranwal November 12, 2026
Bring ChatGPT's Intelligent UI to your app with A2UI 1.0 and CopilotKitYou can now bring ChatGPT’s Intelligent UI to your own app. CopilotKit’s new Generative UI is built on Google’s A2UI 1.0, so your agent can answer with charts, calculators and interactive tools built from your own components and design system. It works with any agent framework, renders in the chat or anywhere on your page, fixes itself when the model slips and takes just two lines of code to set up. Here’s how it works, why A2UI 1.0 makes it possible and how to try it live in the A2UI Playground.
Introducing A2UI 1.0: What’s New in Google’s Framework-Agnostic Generative UI Protocol
Anmol Baranwal and Eli BermanNovember 11, 2026
Introducing A2UI 1.0: What’s New in Google’s Framework-Agnostic Generative UI ProtocolGoogle just launched A2UI 1.0, the first stable version of its framework-agnostic open standard for generative UI. It brings function calls in both directions between the UI and the agent, multiple catalogs on one screen and catalogs that carry your design rules. Here’s everything that’s new, how to migrate from v0.9 and how A2UI 1.0 works with any agent framework via AG-UI. CopilotKit is the fastest way to adopt A2UI 1.0, with a ready-made catalog of 70 components in just two lines of code.
Introducing OpenBot 1.0: An Agent Workspace You Can Make Your Own
Sam Julien and Anmol BaranwalNovember 10, 2026
Introducing OpenBot 1.0: An Agent Workspace You Can Make Your OwnToday we’re releasing OpenBot 1.0, the modular, self-hostable agent workspace with built-in governance. Create a Bot or bring your own agent, pick any model, and connect it to your tools, while you decide what it can do on its own. Run it free on Mac or Windows, or deploy OpenBot for Business on your own infrastructure with SSO and a full audit trail.
Are you ready?

Stay in the know

Subscribe to our blog and get updates on CopilotKit in your inbox.