Appearance
Engines and concurrency
What computes a model, how many people it serves at once, and what happens to the ones who wait. Since 1.5.0.
Three engines, chosen for you
| Engine | Serves | On |
|---|---|---|
llamacpp | GGUF models, whole | the CPU, both agent packages |
vllm | safetensors models, details | an NVIDIA card, cuda agent package |
reference | safetensors models, whole or split over machines | CPU or GPU |
The engine follows the model's format and the machine it lands on: model serve picks it, deployment list shows it, and every request's audit row says backend= with it. --engine chooses one yourself, and is refused when the format or the machine cannot run it.
Every engine batches
A request joins the answers in progress at their next step, on llama.cpp, vLLM and the reference backend, whole or split over machines. Nothing is served one request after another, so four people at once cost far less than four times one. A long prompt is read in chunks, between which the others keep generating, and a greedy answer is the same alone and in a batch.
--max-batch N on model serve is how many answers a deployment computes together, on every engine. By default it is what the machine's memory holds beside the weights at the deployment's context, at most 16. deployment show prints it as max batch, deployment list as llamacpp x4. --slots still works, under its old name.
bash
sudo diffuse-coordinator model serve qwen3-14b --context 16384
sudo diffuse-coordinator deployment list
sudo diffuse-coordinator deployment show <deployment-id>A GGUF model always runs on llama.cpp's server, which the agent package carries. An agent without it refuses the deployment and says so; it never falls back to answering one request at a time.
The queue
In front of the batch is one queue per deployment.
- A request joins the batch, or waits when the batch is full.
- When a place frees, it goes to the caller with the fewest answers running, then to whoever has waited longest. A caller is an API key, or the person a chat gateway asserts, so one client with ten requests does not hold back the next person's first.
- The wait is bounded (
--queue-timeout-son diffuse-api, 600 s). Past it, and when the queue itself is full (queue_sizein/etc/diffuse/agent.toml, 32 by default), the answer is429withRetry-After: the deployment is busy, nothing is broken, and a client that retries on 429 retries. - The generation timeout (
--request-timeout-s, 600 s) counts from the moment a request joins the batch. - A streamed request that waits receives
: queued <position>comment lines, which clients ignore and which keep proxies from closing the connection.
nodes --wide shows, for each slice, BUSY (answers in the batch out of the max batch) and QUEUE (requests waiting).
A slot remembers only its last caller
A slot keeps what it computed for the next request of the same caller, so a coding agent that resends its whole conversation every turn does not pay for it again. A request from anybody else in that slot starts from nothing: whether a prompt was answered quickly must not tell anybody what somebody else asked.
Stopping
An answer stops, and its place in the batch is free again, when its client closes the connection, when its API key is revoked or its person disabled, and when its deployment is removed. Nothing needs restarting.
