Streaming responses
As with the real APIs, the request decides whether it gets a stream:
openaipresets: a request with"stream": truegets an OpenAI-style Server-Sent Events (SSE) stream, and one with"stream": falsegets a single JSON reply, whatever the preset says. A request with nostreamkey (or aGET) goes by the preset'sstreamsetting.claudepreset: it streams when the request body has"stream": true, and the preset setting is ignored (see Anthropic).geminiand custom presets: the preset'sstreamsetting decides, since real Gemini chooses streaming by URL, not by a body field.
Set the preset default in your config or via CLI:
json
{ "stream": true }bash
llmock start --stream=trueWhen a request streams, the endpoint returns a chunked SSE stream. The server waits for the configured response delay, then sends the chunks at least 50 ms apart.
data: {"id":"chatcmpl-123","object":"chat.completion.chunk","choices":[{"delta":{"role":"assistant"}}]}
data: {"id":"chatcmpl-124","object":"chat.completion.chunk","choices":[{"delta":{"content":"Hello"}}]}
data: [DONE]