Local AI Systems
A self-hosted AI model for my coding tools.
In the recorded test, the request was 262,144 tokens long. Tokens are the word pieces a model reads. With the fix, 95% of repeats started within 2.98 s.
Operator and recipe contributor
My cache fix and memory report were merged into the community deployment recipe for GLM-5.3-Flash. The model, runtime, and recipe are other people's work.
Project dates, tools, and platform
- Built
- September 2026
- Software
- vLLM, Docker, Linux, Python
- Runs on
- Two NVIDIA DGX Spark computers
Startup stalled, and repeated requests took three minutes
Processor
Graphics chip
Shared memory
The modelTemporary file copiesFree memory
Model start
–
Starting
Can stallwith no free memory left
Each repeat of a long request
First time191.7 s
Same request again191.7 s
0% of the finished work reused
Each computer's processor and graphics chip share one memory.
Loading leaves temporary file copies that fill the free memory.
With no free memory left, startup can stall.
Each repeat of a long request took 191.7 s again.
The fixes address memory pressure and unused cached work.
Startup memory and prefix-cache failures
Each DGX Spark computer shares memory between its central processor (CPU) and graphics processor (GPU). Loading the model's weights can fill that memory with cached file data. The GPU driver can then fail to find a free block during startup checks in vLLM, the software that runs the model.
The recipe's prefix cache reported zero hits, even for an exact repeat of the same prompt. Each repeat of a 262,144-token prompt was processed from the start and took about three minutes.
A shared interface connects the model to coding tools
My partOther people's work
Coding tools send requests through one shared interface.
Two computers each hold half the model and answer together.
The answer returns to the tool through the same API.
I built the shared interface, health checks, and recovery.
Deployment and my contributions
The model, runtime, and deployment recipe are other people's work. I built the shared application programming interface (API), health checks, automatic startup, recovery, and the fixes described here. I run the community recipe for GLM-5.3-Flash at tensor parallel 2, which splits the model across two computers: vLLM in Docker, 4-bit NVFP4 weights, an fp8 KV cache, and the DFlash2 speculative drafter. NVFP4 is NVIDIA's 4-bit floating-point format. The KV cache holds the attention keys and values of tokens the model has already read. One OpenAI-compatible API serves my coding tools.
Memory and cache fixes address two separate failures
Shared memory
Guard onGuard off
The modelTemporary file copiesFree memory
Model start
Loading
Would failif memory were held back
Started8 GiB kept free
Reloads from disk
–
0in a full test
Repeat answers in
–
191.7 sfirst time
2.98 swas 191.7 s
Power
78 Wbefore the limit
47–50 Wwas 78 W, same speed
A guard clears file copies to keep 8 GiB free.
Holding memory back would fail startup. I kept the default.
Once loaded, the guard stops and a practice request runs.
My cache fix reuses work: repeats start in 2.98 s.
Limiting the graphics chip's clock cut power to 47–50 W.
The recorded test combined startup, cache, and power checks.
Memory guard, cache patch, and clock limit
Guard free memory during the load. Startup can fail when no suitable free memory block remains. A per-node guard drops caches and compacts memory whenever free memory falls under 8 GiB. It checks every second, from launch until the server is ready.
Leave the kernel reserve alone. Raising the kernel's free-memory reserve lowers the available memory that vLLM's startup check reads by about 6.2 GiB. That causes the check to fail before the model loads.
Stop the guard before it causes faults. Major page faults came from two places: the first use of the OpenSSL encryption libraries, and the guard's own cache drops, which evicted mapped weight pages. I stop the worker's guard once the head node is ready, then run one warm-up pass. After that, both nodes had zero major faults through a full qualification run at 262,144-token context.
Separate the drafter cache from the model cache. The drafter keeps its own short sliding-window cache. vLLM treated every cache group as a drafter group, so the draft window's short hit cut the shared hit to zero. My patch flags only the drafter group and never lets it shorten the hit that the model's own groups agree on.
Cap the GPU clock without losing speed. With the cap, decoding stayed at 55.6 tokens per second. Power fell from 78 W to 47–50 W, and temperature from 86 °C to 69–71 °C.
Two contributions merged into the community recipe
Results of one recorded test
- 98.6%of the finished work reused on a repeatwas 0%
- 2.98 suntil the answer to a repeat startswas 191.7 s
- 55.6tokens per second of output
Community recipe by tonyd2wild
- MergedMy cache fixPull request 18 · September 16, 2026
- MergedMy memory reportPull request 19 · September 16, 2026
vLLM, the software that runs the model
- In reviewLower memory use while loadingPull request 55103 · extra memory in a test at one eighth of full size
One recorded test covered both DGX Spark computers.
Maintainer tonyd2wild merged my fix and field-report pull requests.
A third change, to vLLM, is in review.
Two pull requests merged; the vLLM proposal remains in review.
Recorded test conditions and upstream links
| Measure | Result |
|---|---|
| Prefix-cache hit rate, repeated prompt | 0.986, from 0 before the fix |
| Cached tokens on the repeat | 258,048 |
| Time to first token, cold | 191.7 s |
| Time to first token, cached (p95) | 2.98 s |
| Decode speed, one stream (p50) | 55.6 tokens/s |
| Drafter acceptance | 0.928 |
The test sent 262,144‑token requests one at a time. The recipe's maintainer merged my two pull requests on September 16, 2026. In a test at one eighth of full size, the vLLM change cut the extra memory used during loading from 1,011 MiB to 3 MiB.
On my memory report
"This is the most useful GB10 memory write-up anyone has sent us"