Playbook · DGX Spark cluster
Each Spark runs its own complete model server. A small load balancer on the first one gives your apps a single address.
One address is not full backup. Here the balancer runs on the first Spark. If that Spark stops, the address stops too, even though the second server is still running.
Checked on 26 November 2026 against: vLLM's NGINX, Docker and security documentation and NVIDIA's vLLM playbook. We have not yet run this playbook start to finish on our own hardware.
Watch, then follow
Two copies, one address. Two DGX Sparks, a whole model on each. Here's what to decide first.
The AI stack. We're starting from the machines: two DGX Sparks, joined by their cable.
Requests are shared. Not much else. A load balancer shares new requests. Each one runs wholly on one Spark. Its CPU work goes there too, such as turning text into tokens. Model memory, caches, files and settings stay separate.
Pick a method. With no method line, NGINX takes the servers in turn. That's round robin. Least connections picks the server with fewer open. This guide starts there. IP hash follows the caller's address. Through an SSH tunnel, all callers look alike.
Failover is partial. After repeated failures, NGINX leaves a server out for a while. A chat request already sent to a stopped Spark isn't passed on by default. A reply that has started can't move to the other Spark. And if the first Spark stops, the one address stops with it.
Match both copies. Use the same image, model, version and settings on both Sparks. Use the same API key on both. It protects some paths, not all. Docker doesn't restart these containers after a reboot unless you ask.
Now you can decide. Part two sets it up, checks it, and stops it.
9 steps
Set up, check, stop. Now let's set up two copies. We haven't run these steps on hardware.
One key. Make one long random key. Type it in on each Spark, so it stays out of your shell history.
Start vLLM. This loads the GPU and much of the memory, so check both Sparks are free. Set each Spark's own link address, the image and the model. Then start the container. Follow its log until it says the application has started.
Add NGINX. On the first Spark, write the NGINX file from the page, naming both link addresses. Start NGINX. It listens only on that Spark. From your computer, open an SSH tunnel to reach it.
Prove both work. Check each server's health by itself. List the models through the one address, with your key. Send several requests at once, and watch both logs.
Stop one, on purpose. The next test stops a model server, and cuts off whatever it's answering. Stop the second one, then send a new request. It should still be answered. Then start it again, and wait for it to load.
Stop and undo. Stopping ends any replies in progress. Stop the balancer first. Then stop the model server on both Sparks.
Check, then measure. The page shows how to remove it all, and fixes by symptom.
15 steps
Written from the makers' own documents, read on 26 and 27 November 2026 and linked below. We have not run these steps on hardware.
Is this the one?
A model that fits on one Spark, used by several people, apps or batch jobs at once.
Each server is an ordinary single-Spark setup. No data about a request's calculation crosses the cable. You can update one while the other serves, though requests in progress on the one you stop are lost.
It does not let you run a bigger model, and a single request is not faster. Each Spark stores the whole model, and each keeps its own cache, so a follow-up question may land on the Spark that has not seen the first.
Compare all five in the cluster method chooser.
Decide first
| Decision | Your choices | What it changes |
|---|---|---|
| Same model on both? | The same model, revision, image and settings, or not | One address assumes either Spark can answer any request. If the two differ, answers can differ with the Spark that takes the request. |
| What shares the requests? | NGINX, LiteLLM, SGLang's router, or vLLM's own data parallel | The balancing rules, and what else you have to run. |
| How are they shared? | The balancing method | Which Spark gets the next request. |
| What if one Spark stops? | Failure counts, time-outs and retries | How fast the other takes over, and which requests are lost. |
| Where does the balancer run? | On the first Spark (this page), or on a third machine you look after | The balancer's machine is a single point of failure. We have written no steps for a third machine or for a second balancer. |
| Back after a reboot? | A Docker restart policy, or start by hand | Whether the service returns by itself. |
Load balancing
NGINX keeps a list of servers (an upstream group) and picks one for each request. With no method line it uses weighted round robin.
| Method line | How it picks (NGINX upstream reference) | What to think about with two Sparks |
|---|---|---|
| none (round robin, the default) | Takes the servers in turn, by weight. Every weight is 1 unless you set it. | Even turns, even if one Spark is stuck on long replies. |
least_conn | The server with the fewest active connections, allowing for weights. | What vLLM's example and this page use. It counts connections, not the length of each prompt or how busy a GPU is. |
ip_hash | Chooses by the caller's address, so one caller stays on one server. For IPv4 it uses the first three parts of the address. | Through the SSH tunnel on this page, every caller looks like the same local address, so expect everything to go to one Spark. |
hash KEY (with optional consistent) | Chooses by a key you name. consistent moves fewer keys when the list of servers changes. | Can keep one conversation on one Spark, so its cache is there, if your app sends a value that identifies the conversation. We have not written or tested such a key. |
random or random two | A random server by weight. With two, picks two and chooses between them, by least connections unless told otherwise. With only two servers, those two are both of them. | No clear gain here over least_conn. |
least_time | Lowest average response time and fewest active connections. | NGINX says it was paid-only before version 1.31.0. Check your image's version. |
Our advice: start with least_conn, as vLLM's example does, because model replies vary a lot in length. Then look at both logs with your own requests. Our notes about the tunnel and two servers follow from NGINX's descriptions; we have not measured any method.
If you already run LiteLLM, give two entries the same model name. Its routing page names these strategies. We have not tested it with two Sparks.
| Strategy name | How it picks |
|---|---|
simple-shuffle (default) | Weighted pick, using the request and token limits or weights you give; at random with none. LiteLLM recommends it for production. |
least-busy | The entry with the fewest calls under way. |
latency-based-routing | The entry with the lowest response time. |
usage-based-routing-v2 | Leaves out entries over their token or request limits, then prefers lower token use. |
cost-based-routing | The cheapest healthy entry. It is of little use for two identical Sparks. |
For a failed entry, LiteLLM has retries (num_retries) and a cool-down (allowed_fails, and cooldown_time, 5 seconds by default; allowed_fails is not set by default).
SGLang has its own router, the SGLang Model Gateway. You give it both servers with --worker-urls and choose a --policy: cache_aware (tries to reuse each server's cache while spreading load), round_robin, random, or power_of_two (compares two and takes the less loaded). SGLang's guide calls cache_aware right for most work, and describes health checks, retries and taking a failing server out. The gateway page we read names no default policy, so set one. We give no router commands and have not run it; the rest of this page is vLLM with NGINX.
Failover
| What stops | What you should expect from this setup |
|---|---|
| The second Spark, before a request is sent to it | If NGINX cannot connect, it can pass the request to the first server. After repeated failures it leaves the second out for a while, then tries it again. |
| The second Spark, while it holds a request | Expect that request to fail. Chat requests use POST, and NGINX does not by default pass a POST to another server once it has been sent. Your app has to send it again. |
| Either Spark, half way through a reply | The reply is cut off. NGINX cannot move a reply that has started to reach your app. |
| The first Spark | The one address stops. The second server may be running, but this balancer is gone. |
| The cable | The balancer can no longer reach the second Spark. The first can go on alone. |
| Both servers | NGINX returns an error such as 502. |
| Setting | What it controls | Default | This page, and when to change it |
|---|---|---|---|
max_fails | Failed tries, within fail_timeout, before a server is treated as unavailable. 0 turns the counting off. | 1 | 3, as in vLLM's example. Lower reacts to a single failure; higher puts up with more. |
fail_timeout | The window for counting failures, and also how long the server is then left out. | 10s | 30s. Longer means fewer tries at a dead server, and a slower return for a repaired one. |
proxy_next_upstream | Which failures pass a request to the next server, and count as failed tries. | error timeout | Not set. Other status codes, such as 503, are passed on only if you list them. |
its non_idempotent option | Also passes on POST requests that were already sent. | off | Left off. Our caution: turned on, a request may be worked on twice, which matters if your app acts on replies. |
proxy_next_upstream_tries, proxy_next_upstream_timeout | Limit how many times, and for how long, a request is passed on. | 0 (no limit) | Not set. |
proxy_connect_timeout | How long to wait to connect to a server. NGINX says it cannot usually exceed 75 seconds. | 60s | Not set. Shorten it if a powered-off Spark makes requests wait too long; test with your own network. |
proxy_read_timeout | The longest silence between two reads from the server, not the length of the whole reply. | 60s | 600s. A reply that is not streamed sends nothing until it is ready. Longer also means a stuck server holds a request longer. |
proxy_buffering | Whether NGINX gathers the reply before passing it on. | on | off, so a streamed reply arrives as it is made. |
weight | A server's share. | 1 | Not set. For two matching Sparks, leave equal. |
backup, down | backup serves only when the main servers are unavailable. down takes a server out. backup cannot be used with the hash, IP hash or random methods. | neither | down is one way to take a Spark out before work on it (then reload NGINX). |
max_conns | The most active connections to one server. | 0 (no limit) | Not set. |
zone | Shared memory, so NGINX's worker processes share the group's settings and running state. | none | Not set, and not in vLLM's example. We have not tested what changes with it. |
The open-source NGINX learns of a failure only from real requests. Regular health checks of its own are part of NGINX Plus, the paid product. Defaults come from the upstream and proxy references.
Changing the file needs a reload or restart of NGINX. Do it when a short interruption is acceptable. After docker restart spark-front, check the address again; replies under way can be cut off.
vLLM settings
Use the same values on both Sparks. These are the defaults in vLLM's serve reference as read on 27 November 2026, when the newest vLLM release was v0.34.0. The image from NVIDIA's playbook can hold an older vLLM with other options or defaults, so check with vllm serve --help=all inside your image.
| Setting | What it controls | Default | When to change it |
|---|---|---|---|
--host, --port | Where the API listens, inside the container. | No host default is stated; port 8000 | Left as they are here. Docker's -p line decides which Spark address offers it. |
VLLM_API_KEY or --api-key | The key a caller must send on protected paths. | none | Set it, and use the same key on both so either can answer. |
--served-model-name | The model name apps send. | the model you named | To give both copies one plain name. It must match on both. |
--revision | Which version of the model files. | the default version | To pin both Sparks to one commit. |
--max-model-len | The context length, prompt and reply together. | read from the model's own settings file | Lower it if the model does not fit, to what your work needs. |
--gpu-memory-utilization | The share of GPU memory vLLM's model processes may use, from 0 to 1. | Unset. The reference says it then becomes 1.0 with the extensible cache and 0.92 otherwise | The DGX Spark's CPU and GPU share one memory. Do not copy a value from another model or version. |
--max-num-seqs | The most requests worked on in one step. | no single figure; check your version | vLLM's tuning page suggests lowering it, or --max-num-batched-tokens, when requests are often pushed out and restarted. |
--dtype | The number format for the calculation. | auto | Only as the model's own instructions say. |
--tensor-parallel-size | How many GPUs share one copy. | 1 | Stays 1 here: each Spark runs its own copy. |
The commands on this page set no restart policy, and Docker's default is no: after a reboot you start them yourself. Adding --restart unless-stopped to a docker run line makes Docker restart that container, except after you stop it yourself. We have not tested whether the cluster link is ready early enough at boot for these containers to start.
Our note: anyone allowed to run Docker on a Spark can read a container's settings, including a key passed this way.
Before you start
Two DGX Sparks on the same current DGX OS, with the cable link set up and tested as in the cluster setup guide. In the commands, my-spark is the first Spark, spark-two the second, and USER your user name. Replace words in capitals with your own values. Nothing on this page has been run by us on hardware.
The model must run well on one Spark first. Get both Sparks able to download it, with enough free disk on each. The vLLM container image must suit the DGX Spark's ARM processor: start from the tag in NVIDIA's vLLM playbook and use the same one on both.
How it fits together
Set up
Make a long random key, and keep it in your password manager. Enter the same one on both Sparks without it landing in your shell history:
openssl rand -hex 32
read -rs VLLM_API_KEY && export VLLM_API_KEY
Starting a server loads the GPU and takes much of the memory. Check on each Spark that nothing important is using them.
On each Spark, set its own cluster link address, the image tag and the model. Publishing the port on the link address keeps Docker from offering it on your home network address.
export LINK_IP="THIS-SPARK-LINK-ADDRESS"
export VLLM_IMAGE="nvcr.io/nvidia/vllm:TAG-FROM-NVIDIA-PLAYBOOK"
export MODEL="ORG/MODEL"
docker run -d --name vllm-copy --gpus all --ipc=host \
-p "$LINK_IP:8000:8000" \
-v ~/.cache/huggingface:/root/.cache/huggingface \
-e VLLM_API_KEY \
"$VLLM_IMAGE" vllm serve "$MODEL"
docker logs -f vllm-copy
A gated model also needs your own Hugging Face token, passed with -e HF_TOKEN.
Wait until the log says the application has started. The first start downloads the model and can take a long time.
The vLLM documentation shows NGINX sharing requests between servers. This is our two-Spark version of it. Make a folder called nginx_conf and put this in nginx_conf/sparks.conf:
upstream sparks {
least_conn;
server FIRST-SPARK-LINK-ADDRESS:8000 max_fails=3 fail_timeout=30s;
server SECOND-SPARK-LINK-ADDRESS:8000 max_fails=3 fail_timeout=30s;
}
server {
listen localhost:8080;
client_max_body_size 32m;
location / {
proxy_pass http://sparks;
proxy_set_header Host $host;
proxy_buffering off;
proxy_read_timeout 600s;
}
}
docker run -d --name spark-front --network host \
-v "$PWD/nginx_conf:/etc/nginx/conf.d:ro" nginx
docker logs spark-front
Where we differ from vLLM's example: we listen only on the Spark itself, turn buffering off so streamed replies arrive as they are made, allow longer for slow replies, accept requests up to 32 MB (NGINX stops at 1 MB by default, which long prompts and pictures pass), and use a 30 second fail_timeout. vLLM's example uses 10000s, which leaves a failed server out for nearly three hours. Pin an NGINX version once yours works.
Open an SSH tunnel and leave it running. Point your app at http://localhost:8080/v1 and give it the API key.
ssh -N -L 8080:localhost:8080 USER@my-spark.local
The API key does not guard everything. vLLM's security page says --api-key protects paths such as /v1 but not several others, including some that run or pause the model. Keep the servers reachable only on the cluster link and, through the balancer, by SSH.
Check
| Check, run on my-spark | Success |
|---|---|
curl --fail http://FIRST-SPARK-LINK-ADDRESS:8000/health, then the same with the second address | Both return without an error. |
curl http://localhost:8080/v1/models -H "Authorization: Bearer $VLLM_API_KEY" | A list naming your model. |
Send several chat requests at once through port 8080, while running docker logs -f vllm-copy on each | Both logs show requests. |
On spark-two, docker stop vllm-copy, then send a request again; then docker start vllm-copy | The new request is still answered. After loading, the second server takes work again. |
The last check stops a model server. Anything it is answering at that moment is cut off.
Use the same model, model version, image and settings on both, or two identical questions may be treated differently.
Other ways
If you already run a gateway, LiteLLM balances between two entries that share a model name, each pointing at one Spark.
vLLM can run one deployment across two nodes with its own single entry point. The two then depend on each other, unlike the setup here.
A Service can share requests between two pods. See the Kubernetes page. For Python services on a Ray cluster, see the Ray page.
vLLM's data parallel deployment also keeps whole copies of the model, but as one deployment that vLLM balances itself. Its page says this works for dense and mixture-of-experts models. It has these shapes:
| Shape | How requests are shared | Where the API and its CPU work run | Main options |
|---|---|---|---|
| Internal balancing | By vLLM's API server, from each copy's running and waiting requests. | On the first node. The second runs --headless, with no API server. --api-server-count adds API server processes on the first node; its default is the data parallel size. | --data-parallel-size (all copies), --data-parallel-size-local (copies on this node), --data-parallel-start-rank (first copy on the headless node), --data-parallel-address and --data-parallel-rpc-port |
| Hybrid | An outside balancer picks a node; each node queues to its own copies. | On every node. It cannot be combined with --headless. | --data-parallel-hybrid-lb (off by default) |
| External | An outside balancer treats each copy as its own server. | With each copy. | vLLM says its external data parallel options are only for mixture-of-experts models. The setup on this page needs none of them: it is two ordinary servers. |
For two Sparks with one GPU each, the internal shape reads like this when the page's example is cut down to one copy a node. This is our adaptation and we have not run it. Run it inside containers set up as on the split model page:
# first Spark
vllm serve ORG/MODEL --data-parallel-size 2 --data-parallel-size-local 1 \
--data-parallel-address "$HEAD_IP" --data-parallel-rpc-port 13345 \
--host localhost
# second Spark
vllm serve ORG/MODEL --headless --data-parallel-size 2 --data-parallel-size-local 1 \
--data-parallel-start-rank 1 \
--data-parallel-address "$HEAD_IP" --data-parallel-rpc-port 13345
--host localhost keeps the server to this Spark. Without it, vLLM listens on every network the Spark is on, with no password. To reach it from your computer, open an SSH tunnel and use http://localhost:8000/v1:
ssh -N -L 8000:localhost:8000 USER@my-spark.local
This opens traffic between the Sparks that vLLM does not secure by default. Keep it on the cluster link only. With one API on the first Spark, if that Spark stops, the address stops. The page we read does not say what happens when the other node fails. --max-num-seqs applies to each copy.
Stop and undo
Stopping ends any replies in progress.
To stop: on the first Spark, then on both:
docker stop spark-front # first Spark
docker stop vllm-copy # both Sparks
Removing deletes the containers and your NGINX folder. Copy anything you want to keep first.
To undo: remove the stopped containers and the NGINX folder. The downloaded model stays in ~/.cache/huggingface until you delete it yourself.
docker rm spark-front # first Spark
docker rm vllm-copy # both Sparks
rm -r nginx_conf # first Spark
Problems
| What you see | What to try |
|---|---|
| 502 from port 8080 | Neither server is ready or reachable. Check each /health directly. |
| 401 Unauthorized | The app's key differs from the one the servers started with. |
| Docker says it cannot bind the address | LINK_IP is not an address of that Spark, or the link is down. |
| All requests go to one Spark | With one request at a time that can be normal. Test with several at once, and check the other server's health. If you chose ip_hash, callers through the tunnel share one local address. |
| A long reply ends with a time-out error | Raise proxy_read_timeout, or have the app ask for a streamed reply. |
| Requests fail when one Spark is switched off | See what NGINX passes on and what it does not. Your app should send a failed request again. |
| Nothing answers after a reboot | With no restart policy the containers stay stopped. Start them again on each Spark. |
More: cluster problems by symptom.
Next
Server AI Hub is our app for looking after a DGX Spark. You do not need it to follow this playbook. It is coming soon to the App Store and the Microsoft Store.
Sources
Read on 26 November 2026; the decision, sharing, balancing, failover and settings sections on 27 November 2026, from the current documentation then (newest vLLM release v0.34.0; NGINX's reference notes the versions where its behaviour changed). These projects change often; if their pages differ from this one, follow them.
General guidance only, in our own words. Back up before you start; you use these steps at your own risk. NVIDIA, DGX, DGX Spark, ConnectX and CUDA are trademarks of NVIDIA Corporation; Kubernetes, K3s, Ray, PyTorch, vLLM, SGLang, NGINX, Docker and other names belong to their owners. 6ixLabs is not affiliated with or endorsed by NVIDIA or any of these projects.