header-langage
简体中文
繁體中文
English
Tiếng Việt
한국어
日本語
ภาษาไทย
Türkçe
Scan to Download the APP
Partnered With:

CopilotKit open-sourced LLMock: Simulate OpenAI, Claude, and Gemini API responses using JSON files, enabling AI application testing without burning real money

According to 1M AI News monitoring, the AI application development framework CopilotKit has open-sourced its internal testing tool LLMock, a deterministic LLM simulation server, under the MIT license, with zero runtime dependencies (only using Node.js built-in modules). Developers define request matching rules and expected responses using JSON fixture files. LLMock launches a real HTTP server that can be directly called by any process on the same machine (Next.js, Mastra, LangGraph, etc.) without modifying the business logic.

LLMock simultaneously simulates the API formats of OpenAI (Chat Completions + Responses), Anthropic Claude (Messages), and Google Gemini, supports both SSE streaming and non-streaming modes, and also covers the WebSocket API of OpenAI Responses, OpenAI Realtime, and Gemini Live. Matching rules support substrings, regex, and custom predicate functions, can return text responses and structured tool invocations, support error injection (simulating 429 rate limits, 503 outages, etc.), and log all requests for assertion verification. The tool's official statement highlights its key difference from MSW (a commonly used API mock library) as cross-process capability: MSW only intercepts requests within the process, while LLMock is an independent HTTP server that allows multiple processes to hit the same endpoint simultaneously. The tool also includes a Claude Code skill plugin to teach AI assistants how to write fixtures correctly.

The CopilotKit team shared their open-source motivation on LinkedIn: "Every uncertain output that leads to CI failures, every test suite rerun, is burning tokens and piling up API costs."

举报 Correction/Report
Correction/Report
Submit
Add Library
Visible to myself only
Public
Save
Choose Library
Add Library
Cancel
Finish