osolmaz/ling-dgx-spark
Ling 3.0 Flash on DGX Spark
This repo has the files I used to run Ling 3.0 Flash locally on a DGX Spark and connect it to OpenClaw.
The example is a focused four-document invoice task with two text PDFs, one raster receipt, and one larger three-page raster document. The assistant reads synthetic German invoices and bank records, then prepares a periodic VAT draft from the source evidence. The documents and model requests stay on the machine.
Included files
- Launch settings for Ling 3.0 Flash FP4 with the Ling DSpark draft model.
- Launch settings for Ling 3.0 Flash VL FP4, which reads scanned documents directly.
- oomwrap protection for both model launches, with the same memory and swap floors used locally.
- An OpenClaw config with local-model lean mode, bounded concurrency, and a 4096-token compaction cap. Tools run in a sandboxed workspace without network access.
- A one-shot OpenClaw vision tool that sends exactly one image and one prompt to Ling, saves one text result, and aborts the exact SGLang request on timeout.
- The German VAT skill and a link to the synthetic invoice folder.
- Checks that send a real text or image request to the local endpoint.
- A static overview page with the project credits and the pinned versions.
- The exact model revisions and container digests used for the recorded tests, with the measured memory and context limits.
Memory limit
Run only one Ling model at a time. The tested text setup used about 92.5 GiB of resident memory. The current VL setup uses an 81920-token pool shared by at most two running requests. It does not provide two simultaneous full-length 81920-token sequences. The text and VL models do not fit together on a DGX Spark with 121 GiB of unified memory.
The VL launcher allows one image per request, reserves 72% of memory for static allocations, and uses BF16 KV cache. The main OpenClaw route is text-only; image reading goes through the stateless ling_vision_once tool. DSpark is enabled only for the text model.
Quick start
Requirements:
- NVIDIA DGX Spark with its supported NVIDIA container stack.
- Linux on Arm64.
- Docker with NVIDIA GPU access.
- Python 3.10 or later.
- The current
hfCLI. - OpenClaw if you want to run the agent demo.
- Rust and Cargo to install
oomwrap. - A running
earlyoomprocess for machine-wide memory protection.
Clone this Space:
git clone https://huggingface.co/spaces/osolmaz/ling-dgx-spark
cd ling-dgx-sparkInstall the process-scoped memory guard:
cargo install --git https://github.com/osolmaz/oomwrap --lockedDownload the model you want to run. Each download is pinned to a model revision:
bash runtime/download-models.sh vl
# or
bash runtime/download-models.sh textStart the VL endpoint for the invoice demo:
bash runtime/serve-vl.shIn another terminal, verify that an image reaches the model:
python3 runtime/check-endpoint.py vlStop the foreground server with Ctrl+C before you start the text model:
bash runtime/serve-text-dspark.sh
python3 runtime/check-endpoint.py textSee the full setup guide before you connect OpenClaw. It explains the isolated profile, the one-shot vision plugin, and the demo workspace.
Repository map
Demo data
The demo uses `osolmaz/invoice-fixture` at revision `578d05a`.
The documents are synthetic. The agent prepares files for review and does not submit anything to ELSTER.
License
MIT
