Skip to content

Commit b2b7cbe

Browse files
authored
docs: remove MSW comparison from README (#67)
Removes the MSW vs llmock comparison section and table from the README/npm landing page. This content lives on the [docs site competitive matrix](https://llmock.copilotkit.dev/) instead.
2 parents 660a10b + 40b6e8e commit b2b7cbe

1 file changed

Lines changed: 0 additions & 47 deletions

File tree

README.md

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -23,53 +23,6 @@ const url = await mock.start();
2323
await mock.stop();
2424
```
2525

26-
## When to Use This vs MSW
27-
28-
[MSW (Mock Service Worker)](https://mswjs.io/) is a popular API mocking library, but it solves a different problem.
29-
30-
**The key difference is architecture.** llmock runs a real HTTP server on a port. MSW patches `http`/`https`/`fetch` modules inside a single Node.js process. MSW can only intercept requests from the process that calls `server.listen()` — child processes, separate services, and workers are unaffected.
31-
32-
This matters for E2E tests where multiple processes make LLM API calls:
33-
34-
```
35-
Playwright test runner (Node)
36-
└─ controls browser → Next.js app (separate process)
37-
└─ OPENAI_BASE_URL → llmock :5555
38-
├─ Mastra agent workers
39-
├─ LangGraph workers
40-
└─ CopilotKit runtime
41-
```
42-
43-
MSW can't intercept any of those calls. llmock can — it's a real server on a real port.
44-
45-
**Use llmock when:**
46-
47-
- Multiple processes need to hit the same mock (E2E tests, agent frameworks, microservices)
48-
- You want multi-provider SSE format out of the box (OpenAI, Claude, Gemini, Bedrock, Azure, Vertex AI, Ollama, Cohere)
49-
- You prefer defining fixtures as JSON files rather than code
50-
- You need a standalone CLI server
51-
52-
**Use MSW when:**
53-
54-
- All API calls originate from a single Node.js process (unit tests, SDK client tests)
55-
- You're mocking many different APIs, not just OpenAI
56-
- You want in-process interception without running a server
57-
58-
| Capability | llmock | MSW |
59-
| ---------------------------- | --------------------- | ------------------------------------------------------------------------- |
60-
| Cross-process interception | **Yes** (real server) | **No** (in-process only) |
61-
| OpenAI Chat Completions SSE | **Built-in** | Manual — build `data: {json}\n\n` + `[DONE]` yourself |
62-
| OpenAI Responses API SSE | **Built-in** | Manual — MSW's `sse()` sends `data:` events, not OpenAI's `event:` format |
63-
| Claude Messages API SSE | **Built-in** | Manual — build `event:`/`data:` SSE yourself |
64-
| Gemini streaming | **Built-in** | Manual — build `data:` SSE yourself |
65-
| WebSocket APIs | **Built-in** | **No** |
66-
| Fixture file loading (JSON) | **Yes** | **No** — handlers are code-only |
67-
| Request journal / inspection | **Yes** | **No** — track requests manually |
68-
| Non-streaming responses | **Yes** | **Yes** |
69-
| Error injection (one-shot) | **Yes** | **Yes** (via `server.use()`) |
70-
| CLI for standalone use | **Yes** | **No** |
71-
| Zero dependencies | **Yes** | **No** (~300KB) |
72-
7326
## Features
7427

7528
- **[Multi-provider support](https://llmock.copilotkit.dev/compatible-providers.html)**[OpenAI Chat Completions](https://llmock.copilotkit.dev/chat-completions.html), [OpenAI Responses](https://llmock.copilotkit.dev/responses-api.html), [Anthropic Claude](https://llmock.copilotkit.dev/claude-messages.html), [Google Gemini](https://llmock.copilotkit.dev/gemini.html), [AWS Bedrock](https://llmock.copilotkit.dev/aws-bedrock.html) (streaming + Converse), [Azure OpenAI](https://llmock.copilotkit.dev/azure-openai.html), [Vertex AI](https://llmock.copilotkit.dev/vertex-ai.html), [Ollama](https://llmock.copilotkit.dev/ollama.html), [Cohere](https://llmock.copilotkit.dev/cohere.html)

0 commit comments

Comments
 (0)