← all repositories
CopilotKit/aimock

A fake internet for AI apps, on one port with zero deps

It mocks every external AI service your app touches—LLMs, vector DBs, agent protocols—so tests run fast, offline, and without burning API credits.

918 stars TypeScript LLMOps · Eval
aimock
Velocity · 7d
+1.0
★ / day
Trend
steady
star history

What it does

aimock is a mock server and programmatic API that impersonates the external services an AI application typically calls. It covers LLM providers (OpenAI, Claude, Gemini, Bedrock, Azure, and others), agent protocols like MCP and A2A, AG-UI event streams, vector databases, and assorted multimedia and search APIs. Everything binds to a single port, and the package carries zero runtime dependencies.

The interesting bit

The breadth is slightly absurd in the best way: instead of cobbling together separate mocks for your chat model, your vector store, and your agent-to-agent protocol, aimock fakes all of them from one process. It can record real API traffic and replay it with approximate timing physics—preserving time-to-first-token and inter-frame cadence—while also letting you inject chaos like mid-stream disconnects and malformed JSON.

Key highlights

  • Mocks 14 LLM providers plus MCP, A2A, AG-UI, Pinecone, Qdrant, and ChromaDB from a single port.
  • Record-and-replay with timing-aware playback that approximates streaming latency without promising per-token fidelity.
  • Built-in chaos testing: configure probability of 500 errors, malformed chunks, or abrupt disconnects.
  • Zero dependencies; the entire runtime is Node.js builtins.
  • Daily drift-detection CI jobs validate mocks against live APIs to catch spec changes.

Caveats

  • The programmatic class is still named LLMock after the v1.7.0 rename to aimock, which is mildly confusing.
  • Timing replay preserves average pace and TTFT, but chunk count may differ from the original recording.
  • Remote fixture URLs reject redirects and private/link-local addresses by default; local testing requires an opt-out environment flag.

Verdict

Worth a look if you are building or testing AI agents and want deterministic, offline integration tests without maintaining a zoo of separate mocks. Probably overkill if you just need to stub a single HTTP endpoint once in a while.

Frequently asked

What is CopilotKit/aimock?
It mocks every external AI service your app touches—LLMs, vector DBs, agent protocols—so tests run fast, offline, and without burning API credits.
Is aimock open source?
Yes — CopilotKit/aimock is open source, released under the MIT license.
What language is aimock written in?
CopilotKit/aimock is primarily written in TypeScript.
How popular is aimock?
CopilotKit/aimock has 918 stars on GitHub and is currently holding steady.
Where can I find aimock?
CopilotKit/aimock is on GitHub at https://github.com/CopilotKit/aimock.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.