Remote RTX 5090 setup: Codex, Qwen3.8-27B and Tailscale
Once the workstation was powered and on my home network, Codex set up the inference stack from my Mac, measured four serving recipes and moved the connection onto Tailscale. No model port was opened to the internet.

On 19 August 2026 I published the plan for my personal AI lab. The hardware was real, but most of the verbs were still in the future tense. I would install the models, compare the runtimes, test long context and connect the machine to agent workflows.
After that, I used Codex on my Mac to operate the Windows workstation over the local network. It inspected the machine, built the serving environments, and installed and tested Qwen3.8-27B. It then created separate vLLM and SGLang recipes, benchmarked them under matched conditions, repaired persistence problems and kept every inference listener on localhost. Finally I left home and repeated the acceptance test through an encrypted Tailscale route.
How the Mac controlled the workstation
Before installing anything, Codex had to establish which machine it was controlling and over what connection.
A fresh SSH connection verified the Windows host, the account boundary, the operating system, the RTX 5090 and the available storage. Key authentication and strict host-key checking were already working. Remote Login on the Mac stayed disabled, because connections only had to run from the Mac to the workstation.
The connection went through three stages, each with its own acceptance check:
| Stage | Private path | Acceptance check |
|---|---|---|
| LAN bootstrap | Mac → authenticated SSH → Windows/WSL | Host identity, GPU and runtime inventory |
| Local inference | Mac loopback → SSH tunnel → workstation loopback | Model listing plus a real completion |
| Off-site inference | Mac → Tailscale → SSH tunnel → workstation loopback | Fresh external-network SSH plus a real completion |
SGLang and vLLM never needed to listen on a public interface. From the Mac, the model looked like a local OpenAI-compatible API. Underneath, each request crossed an encrypted tunnel to a loopback-only service on the workstation.
The model: Qwen3.8-27B in NVFP4
The main target was a dense Qwen3.8-27B checkpoint prepared in ModelOpt NVFP4 for the RTX 5090. The format matters because a single 32 GB GPU has to hold more than the weights. It also holds runtime workspaces, CUDA graphs, recurrent state, a speculative drafter when one is used, and the KV cache that grows with the conversation.
Making the weights fit was only the first gate. The real question was how much room was left for context and acceleration once the whole serving recipe had loaded.
The launchers also carried the model-specific reasoning and tool-call parsers. A generic template can return fluent text while breaking structured tool calls or multi-turn agent work. Every candidate therefore had to pass text generation, recall, tool calls, vision and repeated stability checks.
Four named profiles for four kinds of work
vLLM and SGLang solved different parts of the problem, so I kept four named profiles instead of forcing every workload through one set of flags.
| Recipe | Engine | Acceleration | Configured context | Role |
|---|---|---|---|---|
| DFlash 2 | SGLang | External DFlash drafter | 32K | Fast daily chat |
| DSpark v2 | SGLang | Target-matched NVFP4 drafter | 32K · 64K · 112K | Longer agent and Deep work |
| Native MTP | vLLM | Four model-native draft tokens | 32K | Simple speculative fallback |
| Baseline / Long | vLLM | No speculation · prefix cache | 32K · 64K · 128K · 262K | Control and maximum context |
Configured length is the server setting, not proof of a completed request at every depth. The longest reported actual prompt was 178,014 tokens on the baseline/long profile; the DSpark long-context run used 77,187. Reserve output tokens and check the physical KV pool for the chosen profile.
All four used a single active sequence and an FP8 KV cache. DFlash proposed several future tokens through a separate draft model. DSpark used a target-matched drafter with a different memory and acceptance profile. Native MTP used Qwen’s own prediction heads, so it needed no second model. The baseline ran without speculation, which gave every speed-up a plain comparison.
I kept the baseline for two jobs. If a fast profile fails, the baseline is the rollback path. If a new flag improves the headline number, the baseline is the reference for checking that the outputs have not changed. A speed result without that control has nothing to be measured against.
Speed results under matched conditions
The main cross-runtime comparison used the same local benchmark suite at 32,768 context, concurrency one, an FP8 KV cache and a warm, loaded server. Each profile had to return a real completion before the suite started.
| Profile | Sustained output | VRAM after suite | Mean accepted length | Reliability gates |
|---|---|---|---|---|
| SGLang · DFlash 2 | 139.7 tok/s | 29,150 MiB | 2.95 | Recall, tool, vision, 5/5 |
| SGLang · DSpark v2 | 110.2 tok/s | 26,494 MiB | 2.05 | Recall, tool, vision, 5/5 |
| vLLM · native MTP | 100.8 tok/s | 30,293 MiB | 2.29 | Recall, tool, vision, 5/5 |
| vLLM · baseline | 84.5 tok/s | 30,503 MiB | none | Recall, tool, vision, 5/5 |
DFlash 2 won the matched 32K decode comparison. DSpark was slower, but it used roughly 2.7 GiB less VRAM after the suite and could serve the longer contexts I wanted for agents. Native MTP sat between speculative SGLang and ordinary vLLM without needing an external drafter.
A later, isolated vLLM tuning pass moved native MTP from three draft tokens to four. Under that pass’s matched conditions, decode rose from 112.8 to 120.5 tokens per second, a 6.8% gain, with unchanged outputs. I keep that result out of the table because it came from a later A/B test rather than the original cross-profile suite.
I also left an older 203.1 tokens-per-second DFlash run out of the headline comparison. It was a real run, but it used a different 512-token test, so its conditions did not match the others.
Context length depends on the KV cache
The KV cache stores the attention state for tokens already processed, so the model does not recompute the whole conversation for every new token. The weights take a fixed share of the 32 GB, while the cache grows with the prompt and the generated text. More concurrent requests multiply the pressure, and the drafter, CUDA graphs and runtime workspaces compete for the same VRAM.
That produced three context numbers, which the dashboard now tracks separately:
- Requested context: what the launcher asks the runtime to reserve.
- Declared model length: what the model API reports as its maximum.
- Physical KV pool: what the loaded runtime can hold on this GPU.
The effective limit is the smaller of the declared length and the physical KV pool. An endpoint can advertise a large number while the loaded configuration has less space.
As a result, the fastest recipe did not get the longest context. DFlash 2 remained my validated 32K speed profile. DSpark’s lower memory footprint allowed 112K. The target-only vLLM recipe could reserve the largest context because it carried no separate drafter.
On a much larger model the weights hit the limit before the cache does; see the Qwen3.8-Flash-Next system requirements.
How far the long-context tests reached
I used progressive three-needle recall tests and recorded the real prompt length alongside the configured ceiling.
| Runtime | Configured context | Actual prompt | TTFT | Recall |
|---|---|---|---|---|
| vLLM Long | 64K | 44,031 tokens | 5.402 s | 3/3 |
| vLLM Long | 128K | 88,203 tokens | 16.264 s | 3/3 |
| vLLM Long | 262K | 178,014 tokens | 53.434 s | 3/3 |
| SGLang DSpark | 64K | 44,031 tokens | 6.280 s | 3/3 |
| SGLang DSpark | 112K | 77,187 tokens | 14.758 s | 3/3 |
The vLLM profile was configured for 262K, but the largest measured prompt contained 178,014 tokens, so I do not call that a full 262K recall proof. The runs do show the practical cost curve: context that fits can still carry a large time-to-first-token penalty.
The prefill change that broke decode
One of the clearest lessons came from a change that looked sensible. I raised DSpark’s prefill chunk to 8,192 tokens, expecting fewer chunks and faster prompt processing.
The larger reservation disabled the draft model’s CUDA graph instead. Decode fell from roughly 109 to 19 tokens per second, although speculative acceptance still looked healthy. Raising static memory restored the graph, but it shrank the intended 114,688-token physical KV pool to 89,528 tokens.
I rejected both configurations.
The setting I kept was a 2,048-token prefill chunk. In a later matched pass it cut median TTFT from 0.722 to 0.645 seconds on 8K prompts and from 4.286 to 3.837 seconds on 35K prompts. Measured prefill rose from 8,129 to 9,081 tokens per second, an 11.7% gain, while decode stayed roughly flat at 108.7 tokens per second.
Time to a finished answer
Decode throughput can reward the wrong thing. A reasoning-heavy configuration can emit speculative reasoning tokens quickly and still take longer to produce the answer a person is waiting for.
So the measurement stack records prompt prefill, first visible token, decode time, total time to a finished answer, speculative acceptance and task correctness as separate numbers. In chat tuning, some thinking runs reported 240–285 decode tokens per second, while a non-thinking configuration at roughly 115 tokens per second finished sooner.
Prefix caching gave a larger practical gain than most flag changes. Repeating a shared prefix of about 16K tokens cut TTFT from 2.891 seconds cold to 0.283 seconds warm, a 90.2% reduction. Stable system prompts matter here, because a timestamp or session identifier inserted into the prefix can invalidate that cache.
Keeping the server running after I log off
The next failures were operational. A process launched through an interactive remote session can die when that session closes. WSL was also terminating the inference runtime at idle boundaries.
The final setup used allowlisted named profiles, persistent startup and automatic tunnel reconnection. A WSL configuration kept the compute instance alive, and the unused GUI layer, which had been crashing in the background, was disabled. The workstation was configured not to sleep or hibernate while plugged in.
A running process did not count as ready. The system distinguished configured, starting, ready, degraded, failed and stopped states, and a listening port was never enough: the gate required model identity and a bounded real completion. The serving guide describes the same setup.
From home LAN to Tailscale
The LAN was a good bootstrap path, but it could not give me access once I left home. I did not want to forward SSH or inference ports through the router.
Codex installed Tailscale on the Windows workstation through the existing LAN SSH session. Device enrolment used a visible browser flow that was already authenticated. No password, one-time code, pairing secret or private key went into a script or repository. A security warning then prompted an update of both clients before the remote path was accepted.
The persistent SSH tunnel was retargeted from the workstation’s LAN identity to its private Tailscale identity. While both machines were still at home, Tailscale correctly used the local network as transport, but the SSH destination was already the encrypted private address.
That still did not prove off-site access.
The off-site acceptance test
I left home with the Mac and joined a different network. Only then did the acceptance test mean anything.
- Tailscale showed a direct encrypted path back to the workstation.
- A completely fresh SSH connection passed strict host verification.
- The persistent inference tunnel survived the network transition.
- Windows SSH and Tailscale services remained available unattended.
- A real request returned from Qwen3.8-27B on the RTX 5090.
The observed path latency was approximately 30 milliseconds. No router port was opened, and the model server still listened only on the workstation itself.
I have left out LAN, Tailscale and public addresses; device and account names; SSH aliases; keys and fingerprints; login material; local paths; and private service endpoints. They would not help anyone reproduce the method, and they would make the live system easier to fingerprint.
Which profile does which job
No single runtime won. Each profile ended up with its own job:
- SGLang with DFlash 2 became the fast 32K chat profile.
- SGLang with DSpark became the lower-VRAM route to 112K agent and Deep work.
- vLLM with native MTP provided a simpler speculative path without a separate drafter.
- vLLM baseline remained the reliable control and rollback.
- vLLM Long traded first-token latency for planned 64K–262K jobs.
The workstation is now a private inference node with named configurations, measured limits, a rollback path and access that keeps working when the control machine leaves the building.
Infrastructure that an AI agent operates remotely needs the same controls as any production system: narrow authority, explicit profiles, matched measurements and an acceptance test run from the network where it has to work.
Use this
Check if a model fits →
← Previous: Building a home AI lab on an RTX 5090: the plan
Want this inside your team’s workflow? The Verified AI Operations Sprint tests one workflow in ten working days. See the sprint →