Mock models are a testing facility, not a governed model. They deliberately bypass the governance pipeline, so they measure your infrastructure, not your model policy. See Limitations.
Quick start
There is nothing to declare. No provider entry, no catalog row, no allowlist grant. Send a request to the LLM Gateway with a model name containingmock:
models / chat-completions). Everything else — model access checks, routing, quota resolution, provider lookup — is short-circuited before it runs.
Available variants
Model name detection
A request is routed to the mock endpoint when the resolved model name contains the stringmock:
matches between two strings is a plain substring test. Two consequences matter in practice:
- It is case-sensitive.
mock-slowis intercepted;Mock-SlowandMOCKare not — they are treated as ordinary model names and will fail to resolve against the catalog. - It matches anywhere in the name, not just as a prefix. Any model whose id happens to contain
mock—mockProd,gpt-4o-mock,my-mockup-model— is silently redirected to the mock endpoint and never reaches its real provider.
Streaming behaviour
Both mock endpoints supportstream: true, but the two transports differ:
This is why
mock-slow appears to do nothing when driven from an agent: the delay lives only in the SSE branch. To measure latency-sensitive behaviour with mock-slow, drive the gateway over HTTP with stream: true.
In streaming mode, completion_tokens reports the number of chunks (2 or 9), not a token count.
Derived behaviours
The mock honours a few request parameters so that clients exercising these code paths still get a well-formed answer:- JSON mode — with
response_format: { "type": "json_object" }, the content becomes a valid JSON object:{"mock": true, "model": "...", "timestamp": "...", "message_count": N}. - Tool calls — if
toolsis non-empty, the mock returns one fabricated tool call against the first declared tool, withargumentsset to{"mock": true}andfinish_reason: "tool_calls". The message content is thennull. - Embeddings —
v1/embeddingsreturns a fixed 256-float vector, replicated to reach 768 or 1536 dimensions with sign and scale variations. The values are meaningless; they are only valid numeric arrays for the pipeline to process.batchSizeandbatchParallelare accepted for API compatibility and ignored.
Limitations
Because no analytics event is emitted, a load test against a mock model exercises the application chain but leaves Observability and quota enforcement untested.
Making a mock model selectable in an agent
The steps above cover direct API calls, which is what a load test needs. If you also want a mock to appear in an agent’s model picker, it must exist as a model specification in the products catalog — the gateway short-circuit works regardless, but the UI only lists declared models.Related
- Model Governance — routing, failover and quota policies that mock models bypass
- Available Models — the catalog of real models
- LLM Gateway API — full endpoint reference