Open-source llm-mock server fakes OpenAI, Anthropic, Gemini and Azure APIs so CI tests never need a real key
OkSkirt1039 · reddit · 2026-11-22
A developer open-sourced llm-mock, a server that speaks the real wire formats of major LLM APIs so you keep the official SDK and only change the base URL — no real API key in CI, no drifting hand-written mocks.
Highlights:
- Mocks OpenAI, Anthropic, Gemini (AI Studio and Enterprise), and Azure OpenAI under separate URL prefixes
- Covers chat completions, Responses API, Messages API, generateContent, tool calls, embeddings, files, batches, token counting, and SSE streaming
- Deterministic: same request always returns the same response (content-hash IDs, hash-seeded embeddings), keeping snapshots and assertions stable
- Stateless: consistent across restarts and replicas
- Echoes your last message by default; request headers let you set exact replies, tool calls, or content-filter verdicts
- Returns each provider's real error formats for invalid keys, unknown models, and validation errors — unhappy paths testable too
Built with Bun + TypeScript, MIT licensed, with a Docker image and a free hosted instance at api.llm-mock.dev. Positioned for testing the plumbing around models (retries, streaming parsers, tool-call handling, error handling), not prompt quality evaluation.
More from coding & agent
- Indie dev ships SteerCamp, an 'OS for the post-AI era' workspace — pramodk73 · 2026-11-22
- FrankenRobotics: an AI-agent-run robotics lab that batch-designs 256 robots per GPU run — doodlestein · 2026-11-22
- AI short film 'The Wow Lunch': Midjourney images animated by Seedance 2.5 via Claude MCP — azed_ai · 2026-11-22
- Muse Code CLI vs AFK Pilot vs T3 Code: a feature-by-feature comparison chart — PawelHuryn · 2026-11-22
- Astra-6.2 'lazy' backlash blamed on user education: default manual mode vs goal mode — alexisgallagher · 2026-11-22
- David Hoang predicts local models will be the developer obsession this holiday — davidhoang · 2026-11-22