Cookbook
Concrete, copy-paste recipes that string the commands together for a real goal. Each assumes dlm is installed — see Installation.
Run your first model
Pull a tiny model and generate text on CPU — no GPU, under a minute.
$
dlm pull Qwen/Qwen2.5-0.5B-Instruct$
dlm generate --model-path ./models/Qwen2.5-0.5B-Instruct --text "Hello"Serve a 70B on a 16 GB card
The headline case. Profile first to see the plan, then serve with layer streaming so the model exceeds resident VRAM.
$
dlm profile --model-path ./models/Llama-3.3-70B-Instruct$
dlm serve --model-path ./models/Llama-3.3-70B-Instruct --stream --device gpu --port 8000$
curl http://127.0.0.1:8000/v1/chat/completions -H 'Content-Type: application/json' -d '{"model":"dlm","messages":[{"role":"user","content":"Explain layer streaming"}]}'Tune the resident window with
--resident-layers; see Performance tuning.Speed it up with speculative decoding
Pair the target with a small draft model — accepted tokens advance in bulk, with identical greedy output. Without one, n-gram lookup is already on by default on the GPU (--speculative auto).
$
dlm serve --model-path ./models/Llama-3.3-70B-Instruct --draft-model-path ./models/Llama-3.2-1B-Instruct --device gpuServe for a small team
Bind to the network behind a key, and terminate TLS at a proxy — see Deployment & security.
$
dlm serve --model-path ./models/Llama-3.1-8B-Instruct --host 0.0.0.0 --port 8000 --api-key sk-secretScale across GPUs
Split the layer stack across local cards to widen the resident window — details in Distributed & multi-GPU.
$
dlm serve --model-path ./models/Llama-3.3-70B-Instruct --multi-gpu-ids 0,1 --device gpu