Distributed serving (fleet mode)
Fleet mode runs one Superfluid as a head that owns the HTTP API and the chat template, and one or more node agents (superfluid-noded) that each own a model and sample its tokens. Each request is placed as a whole session on one node. Prompt tokens, sampled tokens and what a request carries (its grammar, media files, and its text when a node encodes it) cross the network; weights and KV caches do not.
WARNING
Fleet mode is early. No KV moves between nodes, so a failover re-prefills; and /slots does not reach the nodes.
Join a node
On the head, make the token once and start serving with a listener for nodes:
superfluid fleet token # prints the token; kept at ~/.superfluid/fleet/token superfluid serve basecompute/Qwen3.8-27B --http 0.0.0.0:8453 --fleet-listen 0.0.0.0:8454
On each node:
superfluid node join --model basecompute/Qwen3.8-27B --token <the token>
The node finds the head on the local network (_superfluid-fleet._tcp, which also carries the head's HTTP port for superfluid top, or give <host:port> as the first argument), pulls the model as serve would, serves it over an encrypted link, and dials again whenever the link drops, looking for the head anew when it moved. The head lists a node that joined as joined:<identity> and places sessions on it like any other; a node that leaves is waited for, not dialed. The head matches nodes by model name: a node names its model as the head announced it, so the same model under another id or path still matches; --model-name overrides that. A head with no token takes nodes from its own machine only.
Several fleets can share one local network. A head with a token announces a network id derived from that token, and a node joins only a head of its own token's network. A head of another network is never joined; the node says so once and keeps looking. A head that announces no network id (an older release) is joined only when no head of the node's network answers. When a node loses its head it looks again the same way, so it may join another machine of its network that took over. A head given as <host:port> is dialed only there, never looked for.
On Windows, other machines reach a head (its --fleet-listen and --http ports) or a superfluid-noded node only where Windows Defender Firewall allows the program inbound connections, and by default it allows none to a program it has no rule for. A node then finds the head and cannot connect (the head at <addr> does not answer). Windows asks about a program the first time it listens when it was started from the desktop; started over ssh or as a service, nothing asks and it stays blocked. Allowing it takes an administrator, once. A rule for those TCP ports alone lets in a node given the head's address, and not a node that looks for the head: the head's announcement goes out when it starts, so nodes already looking find it and join, while a node started later asks the network on UDP port 5353, is not heard, and keeps looking (no fleet head of this network answered). Allow the program, or that port as well, or give nodes the head's address. A Windows machine that joins with superfluid node join dials out and needs no rule.
| flag | default | meaning |
|---|---|---|
--model <path|id> | required | the model; an id is pulled first; again for each more the node serves (Several models on one node) |
--token <value> | $SUPERFLUID_HOME/fleet/token | the head's token, kept at that path |
--runtime <id> | by format | the runtime |
--max-context <N> | sized for this device | the node's window |
--max-batch <N> | 8 | the node's lanes, each model's with several |
--class-lanes <class>=N[,...] | uncapped | the lanes each QoS class may hold here, each model's with several (QoS) |
--identity <name> | the host name | the name in the head's logs |
--model-name <id> | what the head announces, else the model's id | the name the head matches on; with several models, once per --model in the same order |
--offline | off | pull nothing |
--speculate <strategy|off> | auto on basert, else off | speculative decoding on the node, as serve takes it (Speculative decoding) |
--park | off | keep each prompt's prefix on disk, so a restarted node starts it warm (Durable sessions) |
--park-lossy | off | park in the lossy Q8 tier, on F16 KV pools; implies --park |
--park-budget-gb <N> | 20 | disk budget for the parked prefixes, oldest evicted first; 0 is unbounded |
--kv-bits <0|4|8|16|84> | 0 (auto) | KV cache precision, on runtimes that take it (basert); the window is sized with it |
--<runtime>-<name> <value> | a knob of that runtime, checked against what it declares, as serve takes it (superfluid runtime options <id> lists them) | |
--prefill-budget, --tick-decode-budget, --tick-target-ms | as serve | the node's scheduler budgets per tick |
--spec-draft-tokens, --[no-]spec-adaptive, --spec-min-yield, --spec-yield-rounds, --[no-]spec-throughput-gate, --spec-gate-probe-tokens, --spec-min-speedup, --spec-gate-reprobe, --spec-gate-reprobe-max, --dspark-confidence, --[no-]spec-bitexact | as serve | tune the node's speculation (Speculative decoding) |
--otlp-endpoint <url>, and --otlp-header, --otlp-service-name, --otlp-filter, --otlp-queue, --otlp-batch-ms, --otlp-timeout-ms | off | push the node's operational traces (never content) to an OTLP/HTTP collector, as serve does |
--log-format <text|json> | text | json: every stderr line is one JSON event, for a program that runs the node (Start-up events) |
A node that joins opens one connection per lane, and the head runs one generation per connection, so a node runs as many generations at once as it has lanes, joined or dialed. The head also asks it for one connection more, which no generation takes: a short call (a prompt's encoding, a state operation) goes over it while every lane is generating. A node from before this release opens only its lanes.
Several models on one node
superfluid node join --model basecompute/Qwen3-8B --model basecompute/Qwen3-0.6B --token <the token>
Give --model more than once, to node join or to superfluid-noded, and the node serves each model at once, as serve serves several: each on an engine and daemon of its own with --max-batch lanes, their windows sized together so they all fit on the device, each model's drafter counted (--max-context gives each that window instead). Models on runtimes of different families are not sized together, as serve does not size them: each gets 8192 unless --max-context pins it. The node has one connection per lane of each model, tells the head every model with its own tokenizer and window, and runs each session on the model the head placed it for; everything else the head asks (a prompt's encoding, the tokenizer it shares, embeddings, a LoRA, the media a request brings, any state operation) runs on the model the request names. The head takes on each model the node brings, and holds each to its own tokenizer and window, as it does models of nodes that serve one.
Each model is served under its own name, org/model for one given by id and the file's name for one given by path; give --model-name once per --model, in the same order, to name them otherwise. The first model keeps the node's session store and parked prefixes; each other keeps its own in a directory under $SUPERFLUID_HOME/fleet/nodes/<identity>/models. A node with no --model follows the head's first model and serves that one only.
A head from before this release does not say which model a session or request is for, so a node serving several offers such a head its first model only, and runs everything that head asks on it.
Run a node by hand
superfluid-noded --model basecompute/Qwen3.8-27B --listen 100.64.0.2:8454
The node loads the model as superfluid serve does: an id is pulled, the runtime that reads it is installed if it never was, and the window is sized for the device. It checks its token and binds its port first, so a node that would be refused stops before it downloads anything. It then prints what it serves:
superfluid-noded: runtime basert serves /…/Qwen3.8-27B-Q4.base: context window 40960 tokens (sized for this device), 8 lanes superfluid-noded: node 'box-a' serving 'basecompute/Qwen3.8-27B' on 100.64.0.2:8454 (Link F/TCP)
| flag | default | meaning |
|---|---|---|
--listen <ip:port> | 0.0.0.0:8454 | where the head connects |
--model <path|id> | required | the model; an id is pulled first; again for each more the node serves (Several models on one node) |
--runtime <id> | by format | basert, llamacpp or mlx; --engine is the same flag, and --engine mock serves the test engine |
--model-name <id> | the model's id | the name the head matches on; set it the same on every node; with several models, once per --model in the same order |
--max-context <N> | sized for this device | the node's window, floor 512 |
--max-batch <N> | 8 | the node's lanes, each model's with several |
--class-lanes <class>=N[,...] | uncapped | the lanes each QoS class may hold here, each model's with several (QoS) |
--identity <name> | the host name | the name in the head's logs |
--offline | off | pull and install nothing |
--speculate <strategy|off> | auto on basert, else off | speculative decoding on the node, as serve takes it |
--park | off | keep each prompt's prefix on disk, so a restarted node starts it warm (Durable sessions) |
--park-lossy | off | park in the lossy Q8 tier, on F16 KV pools; implies --park |
--park-budget-gb <N> | 20 | disk budget for the parked prefixes, oldest evicted first; 0 is unbounded |
--kv-bits <0|4|8|16|84> | 0 (auto) | KV cache precision, on runtimes that take it (basert); the window is sized with it |
--<runtime>-<name> <value> | a knob of that runtime, checked against what it declares, as serve takes it (superfluid runtime options <id> lists them) | |
--prefill-budget, --tick-decode-budget, --tick-target-ms | as serve | the node's scheduler budgets per tick |
--spec-draft-tokens, --[no-]spec-adaptive, --spec-min-yield, --spec-yield-rounds, --[no-]spec-throughput-gate, --spec-gate-probe-tokens, --spec-min-speedup, --spec-gate-reprobe, --spec-gate-reprobe-max, --dspark-confidence, --[no-]spec-bitexact | as serve | tune the node's speculation (Speculative decoding) |
--otlp-endpoint <url>, and --otlp-header, --otlp-service-name, --otlp-filter, --otlp-queue, --otlp-batch-ms, --otlp-timeout-ms | off | push the node's operational traces (never content) to an OTLP/HTTP collector, as serve does |
--auth-file <path> | $SUPERFLUID_HOME/fleet/token | the fleet token; with it the link is encrypted and both ends are checked |
--insecure-no-auth | off | accept any peer on a non-loopback address |
--handshake-timeout-ms <N> | 10000 | time a connecting head has to say hello |
--idle-timeout-ms <N> | 30000 | drop a connection the head has said nothing on for this long; keep it well above the head's 5 s heartbeat |
Nodes can run different runtimes for the same model, such as a Mac on baseRT with the .base build and a Linux box on llama.cpp with a GGUF. Give each the same --model-name. The head sends token ids, so the builds must share the model's tokenizer, which builds of one model do; nothing checks this yet. Each node's answers follow its own build's quantization.
superfluid fleet token makes the token (32 random bytes as hex, owner-readable) at $SUPERFLUID_HOME/fleet/token on the head; copy that file, or its value, to the same path on each node. With a token the link between head and node is encrypted (Noise, keyed by the token) and a peer with another token is refused at the handshake. A node bound off loopback refuses to start without a token unless --insecure-no-auth is given. Both kinds of node read and check the engine flags above as serve does, and refuse one the runtime cannot take before they serve. A node has no sampling flags: the head resolves each request's sampling, its own defaults included (below), and a node applies what the request carries. Its session store lasts one run: a node's sessions last one generation, and the head keeps the conversations. superfluid-noded keeps it under the system temp dir, and node join under $SUPERFLUID_HOME/fleet/nodes/<identity>.
Run the head
superfluid serve /models/qwen.base --http 0.0.0.0:8453 \
--fleet 100.64.0.2:8454,100.64.0.3:8454 \
--fleet-auth /etc/superfluid/fleet.key
At start the head connects to every node and reports each one, or why it cannot reach it:
superfluid: fleet node 'box-a' at 100.64.0.2:8454: qwen, context window 32768 tokens, 8 lanes superfluid: fleet node 100.64.0.3:8454: closed the connection at the handshake; check that --fleet-auth holds the key in the node's --auth-file; retrying it every 10 s superfluid: qwen: context window 32768 tokens (the largest node's)
Give --model once per model the fleet serves; a request's model picks the nodes serving it, and /v1/models lists each. The head never loads a model's weights. A model given by path is opened there for its tokenizer and chat template only. A model given by id (org/model[:tag]) is not pulled at all: the head takes its tokenizer and chat template from the first node serving it, under the id without its tag (start the node with --model-name org/model), and has a node encode each request's text, once per request; the head waits for such a node before it serves, and needs no runtime installed. Each node tells the head its tokenizer, and a node whose tokenizer differs from the head's for that model gets none of its requests (the head says so in its log). A node that joins names its model after one the head serves when its own id is one of them, or after the head's only model; with several and none its own, give it --model-name.
superfluid serve /models/qwen.base /models/gemma.base --http 0.0.0.0:8453 --fleet-listen 0.0.0.0:8454
| flag | default | meaning |
|---|---|---|
--fleet <host:port>[,...] | nodes the head dials; optional with --fleet-listen | |
--fleet-listen <addr:port> | off | take nodes that join, announced on the local network |
--fleet-auth <path> | $SUPERFLUID_HOME/fleet/token | the fleet token; without one the links are not encrypted |
--fleet-policy | load-aware | load-aware, least-loaded or round-robin |
--fleet-pool-high <pct> | 90 | load-aware avoids nodes at or above this KV occupancy |
--fleet-conns-per-node <N> | the node's lanes | connections to each node in --fleet, and so concurrent generations there |
The head loads no engine. A model given by path is still read there for its tokenizer and chat template; one given by id takes them from a node, as above. Its model id must match what the nodes advertise (the head warns about a node that serves another). Its context window is the nodes', so it needs no --max-context. It logs where each session is placed and every move to another node. --dialect, --tool-call-parser and --temperature/--top-p/--top-k/--min-p apply on the head, and so do --repeat-penalty, --presence-penalty and --spec-max-temperature: the head resolves a request that names none with them before a node sees it, and the node applies them as the request's own, so a request's own value still wins. As on one machine, the presence default applies where the nodes' engine applies penalties itself (basert), and the temperature cap where the nodes speculate; the head learns both from the first node serving the model, and again whenever a node joins, comes back, goes down or is removed, so give every node of a model the same runtime and --speculate. --api-key, --key-policy and --rate-limit protect its listener. --http-default-qos, --no-http-qos-header, --http-allow-batch-invariant and a policy's class, max_class and batch_invariant apply on the head as on a single server (QoS).
Refused on the head: --otlp-endpoint, which traces a scheduler the head does not have (give it to each node: superfluid node join … --otlp-endpoint <url>); --class-lanes, since lane caps are a scheduler's and each node runs its own (set it on each node: node join --class-lanes, superfluid-noded --class-lanes); and --fim-model, since the head does not send FIM completions to a node (serve them from one machine's own superfluid serve --fim-model). The engine flags a node takes (--kv-bits, --speculate, the --spec-* knobs, a runtime's options) go on each node.
QoS
The head resolves each request's QoS class as a single server does (x-superfluid-qos, --http-default-qos, the key's class and max_class, SetQos) and sends it to the node with the session. The node's scheduler admits the generation in that class, under the node's own --class-lanes: lane caps are a scheduler's, and each node runs its own, one for each model it serves. The head places by load, not by class. A node from before 0.1.7 runs every generation in the completion class.
A batch-invariant lane (x-superfluid-batch-invariant, under --http-allow-batch-invariant or a key that grants it, or SetQos) is placed only on a node that can run it alone, and runs alone there, as on a single server: nothing else is admitted to that model's engine on the node while it runs or waits (a node serving several models runs each on an engine of its own). A node from before this release cannot: when every node serving the model is one, the request is refused with 400 unsupported_on_fleet, naming them.
Placement policies
| policy | how it picks |
|---|---|
load-aware (default) | prefers nodes whose window fits the prompt, skips nodes above --fleet-pool-high, then the lowest estimated completion time from each node's reported rates. A node measures its rates only while it is generating, so an idle node keeps the speed it showed when busy; one that has not generated yet counts at the mean of the others |
least-loaded | fewest sessions in progress plus requests in flight on that node, whatever its speed |
round-robin | rotate through capable nodes; use it to prove a fleet is distributing |
load-aware and least-loaded first try the node that last ran the longest prefix of the prompt, 128 tokens or more, while it has a lane free. A conversation's turns so stay on the node that has its prefix cached, and other prompts are placed by load. The head keeps this in <sessions>/fleet-warm.json, so it holds across a head restart.
A prompt no node can hold is refused with context_length_exceeded.
What the head serves
The head runs the same HTTP server as superfluid serve on one machine, with the same handlers; each generation's decode loop runs on a node, so no token waits on the network between steps.
- Every API format, streaming or not, with tools: OpenAI Chat Completions, Completions and Responses (OpenAI API), Anthropic Messages, and Ollama
/api/chatand/api/generate. GET /v1/models: the model the fleet serves, with the largest window a node serving it has.GET /metrics: the server's own series, and each node as the head sees it, labellednode,addrandmodel:superfluid_fleet_node_up,_lanes,_lanes_active,_queue_depth,_pool_blocks_used,_pool_blocks_totaland_decode_tokens_total.modelis what the head places on the node, from its report, several joined by,; it is empty until the node has answered. A generation's tokens count as they arrive. The KV pool is the node's latest status, sent every 2 s. Each node's status also carries its scheduler's counters, which the head lists per node assuperfluid_fleet_node_prefill_tokens_total,_warm_prefix_tokens_total,_cold_admissions_total,_preemptions_total,_admits_deferred_total,_spec_proposed_total,_spec_accepted_total,_parks_total(byencoding),_resumes_totaland the rest of the server's scheduler counters, and adds into its own series of the same name (superfluid_spec_proposed_totaland so on), so the head's/metricsreads as one server's does. A node's series count from its start, and keep counting across its restarts while the head runs; the head's sums keep what a node counted after it leaves or is removed. A node released before these counters has none of the per-node series and adds nothing.superfluid_fleet_head_infonames the head's default model asmodeland every model it serves asmodels.superfluid toppointed at the head, or run with no address on the head's network, shows every node from it, with its model.GET /health: 200 with{"status": "ok"}while a node that is up serves at least one of the head's models, 503 with"no_nodes"while none does. Both carrynodes_upandnodes_knownover every node, andmodels, each model's ownnodes_up. It needs no API key.GET /v1/fleet/nodesandDELETE /v1/fleet/nodes/{name}: the head's nodes, and removing one (List and remove nodes).
Structured output (response_format, tool grammars), logit_bias, logprobs, presence, frequency and repeat penalties and ignore_eos reach the node that runs the generation: the head keeps a grammar or bias and the node compiles it. Embeddings (/v1/embeddings, /api/embed) run on a node serving the model. A LoRA (/v1/lora/load, /unload) is loaded on every node serving the model, from a path on each node; load it again after a node joins. These need nodes on this release; an older node refuses them by name.
Image and audio parts, and transcription (/v1/audio/transcriptions, /translations), reach the node too: the head sends each file once per connection, by its SHA-256, and the node keeps it in its own media pool. A streamed transcription's segments come through as the node has them. The head describes the model as the first node serving it does (capabilities in /v1/models), so a route refuses what the nodes cannot do as a single server refuses what its engine cannot.
Slots (/slots) answer that they do not reach fleet nodes yet. A generation has a ten-minute wall-clock ceiling.
List and remove nodes
GET /v1/fleet/nodes lists the nodes the head knows, in the order it learned them. It follows the API's auth, as /v1/files does; a server that is not a fleet head answers 404 with not_a_fleet_head.
{"object": "list", "schema": 1, "data": [
{"object": "fleet.node", "name": "spark", "addr": "10.0.0.22", "connection": "joined",
"up": true, "since": 1763020800, "models": ["qwen"], "sessions": 2,
"lanes": 8, "lanes_active": 2, "queue_depth": 0, "kv_blocks_used": 120, "kv_blocks_total": 4096,
"decode_tokens": 51234, "max_context_tokens": 32768, "max_lanes": 8}
]}
name is the node's identity, or the address the head dials while it has not answered; addr is where a joined node dialed from, or where the head dials it. connection is joined (superfluid node join) or dialed (--fleet). since is when the node last came up or went down, in Unix seconds. models is what the head places there, empty until the node has answered. sessions counts the generations placed there now, lanes the connections open to it and lanes_active the generations the head has running there; max_context_tokens and max_lanes are what the node reported. schema grows only by fields added.
DELETE /v1/fleet/nodes/{name} removes a node, named as the list names it or by its address, until the head restarts. The head closes the node's connections, telling it on each; a generation running there moves to another node as it does when a node fails, with no token delivered twice. The head no longer places on, lists, counts or dials the node, and refuses its identity when it dials in again. The answer is 200 with the node's entry and "removed": true, 404 with node_not_found for a name it does not list, and 409 with node_ambiguous when several nodes go by the name. The head logs fleet node '<name>' removed (by <address>), and with --log-format json writes a fleet.node.removed event (Start-up events).
Removal changes the fleet for every client, so it is an admin route: with --key-policy it takes a key with admin: true. A head with no API key takes it only from its own machine; from elsewhere it answers 403 with admin_required, so start the head with --api-key to remove nodes from another machine.
A node that joined exits when the head removes it, with code 5 and the head at <addr> removed this node; it will refuse it until it restarts (with --log-format json, a node.removed event and then error); a node that follows the head's model does not start again to follow it. Started again with no --model, the node is refused when it asks the head what it serves, and exits the same way before it pulls anything. superfluid-noded keeps serving other heads and says the head removed it once per head. A node from before this release is not told: it sees its links close and dials again, and the head turns it away each time, logging that once.
superfluid fleet nodes [<head>] [--json] # a line per node: address, link, state, lanes busy, models superfluid fleet remove <name> [<head>] # remove one
<head> is the head's HTTP address, 127.0.0.1:8453 by default; the key, when the head has one, is read from SUPERFLUID_API_KEY.
Failure handling
| event | what happens |
|---|---|
| node fails mid-stream | delivered tokens become context; the session is re-placed on the next capable node, which generates the rest. No token is delivered twice |
| node unreachable | skipped; the head tries it again every 10 s and uses it once it answers |
| node restarts | comes back with an empty cache, or with the prefixes it kept under --park; the head reconnects, and a conversation's next turn goes back to it |
| connection idle or busy | each end sends a heartbeat when it has sent nothing for 5 s, during a generation too; a connection a node closed anyway is replaced before it is used |
| node goes silent | after 30 s with nothing from it, the head gives the connection up and re-places what ran there, as for a node that failed |
| node removed | its connections close and what ran there is re-placed, as for a node that failed; the head refuses it until the head restarts (List and remove nodes) |
| head restarts | in-flight requests fail; a client that retries with its Idempotency-Key gets a finished answer replayed, and one the restart cut short runs again (Retrying with Idempotency-Key). The head still knows which node ran each conversation, so the next turn goes where it is warm |
| head misses a lease renewal | the node fences the session and emits nothing more; the head stops waiting 30 s past the generation's wall-clock budget |
Durable sessions
The head keeps every conversation; a node keeps only what makes the next turn fast, its cache of prompt prefixes. Two things make that survive a restart:
- The head remembers which node ran each prompt prefix and sends a conversation's next turn there (see Placement policies), across a head restart too.
- A node started with
--parkwrites each prompt's prefix of 1024 tokens or more to disk under$SUPERFLUID_HOME/fleet/nodes/<identity>/park, up to 20 GiB, the oldest swept first. After the node restarts, a turn whose prompt one covers starts from it instead of prefilling the whole conversation again. Writing a new prefix copies its cache at the end of that generation, which delays that response's finish and holds up the lanes beside it, so it is off by default; a prefix that one kept already mostly covers is not written again. Prompts with images or audio, and models whose cache holds more than one kind of state (hybrid or sliding-window attention), are not kept.
It pays off where prefilling is slower than reading the prefix back. With Qwen3 4B (baseRT, 4-bit) and a 9.3k-token conversation:
| node | cold first token | warm in the node's cache | after a node restart, with --park |
|---|---|---|---|
| Apple M4 Pro | 19.1 s | 0.39 s | 1.6 s |
| NVIDIA GB10 | 1.6 s | 0.2 s | 4.6 s |
On the GB10 the restart is faster without --park.
A request a head restart cut short runs again when the client retries it with its Idempotency-Key; it is not continued from where it stopped.
Limits
- No KV transfer between nodes: a failover re-prefills.
- The head does not cap lanes per QoS class across the fleet; each node caps its own (
--class-lanes).