LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

aimock

Mock infrastructure for AI application testing

TLDR

Start a mock server with fixtures
$ npx aimock -p [4010] -f [./fixtures]
copy
Start from a configuration file
$ npx aimock --config [aimock.json]
copy
Record real API responses as fixtures
$ npx aimock --record --provider-openai [https://api.openai.com]
copy
Convert fixtures from another tool
$ npx aimock convert [vidaimock] [./templates/] [./fixtures/]
copy
Run with Docker
$ docker run -d -p 4010:4010 -v [./fixtures]:/fixtures ghcr.io/copilotkit/aimock -f /fixtures
copy

SYNOPSIS

npx aimock [options]npx aimock convert format source destination

DESCRIPTION

aimock is deterministic mock infrastructure for testing AI applications. It mocks LLM APIs, image generation, text-to-speech, transcription, video generation, MCP tools, A2A agents, AG-UI event streams, vector databases, search, rerank, and moderation — all from one package on one port with zero dependencies.The tool supports 11 LLM providers including OpenAI, Claude, Gemini, Bedrock, Azure, Vertex AI, Ollama, and Cohere with full streaming support. Record & Replay mode proxies real APIs and saves responses as fixtures for deterministic test playback. Chaos testing capabilities allow simulating failures and edge cases.aimock runs daily against real provider APIs and catches response format changes within 24 hours, maintaining fixture compatibility. It is built entirely on Node.js builtins with no external dependencies.

PARAMETERS

-p, --port number

Port to listen on (default: 4010)
-f, --fixtures directory
Path to the fixtures directory
--config file
Load configuration from a JSON file
--record
Enable record mode to proxy real APIs and save responses as fixtures
--provider-openai url
OpenAI provider URL for proxying in record mode
convert format source dest
Convert fixtures from other tools (vidaimock, mockllm)

CAVEATS

Intended for testing environments only, not production deployment. Requires Node.js for npx usage or Docker for containerized deployment. Record mode requires valid API keys for the providers being recorded. Fixture format is specific to aimock and may need conversion from other mocking tools.

HISTORY

aimock was created by the CopilotKit team and written in TypeScript. It was developed to address the challenge of testing AI applications that may touch multiple external services in a single request — LLMs, tool servers, vector databases, rerankers, and moderation layers — providing a single mock server that covers the entire agentic stack.

SEE ALSO

node(1), npx(1), docker(1)

Copied to clipboard
Kai