Complete LLM server setup for DGX Spark (128GB RAM, Blackwell GB10). All files are organized in this folder.
llm_server/
βββ π vLLM Servers (RECOMMENDED):
β βββ vllm_server.py # vLLM-optimized server (2-3x faster, 50% less RAM)
β βββ install_vllm.sh # Install vLLM in isolated environment
β βββ run_vllm.sh # Quick launcher for vLLM server
β
βββ π Legacy Server (HuggingFace):
β βββ llm_server.py # Original transformers-based server
β
βββ π Documentation:
β βββ README.md # This file
β βββ LLM_SERVER_README.md # Original usage documentation
β
βββ π₯ Download Scripts:
β βββ download_nvfp4_models.py # NVFP4 models downloader (cache-aware)
β βββ download_nvfp4_models.sh # NVFP4 downloader (hf CLI)
β βββ download_gguf_models.py # GGUF quantized models downloader
β βββ download_gguf_models.sh # GGUF downloader (hf CLI)
β βββ download_models.sh # Quick wrapper for NVFP4 downloads
β βββ download_gguf.sh # Quick wrapper for GGUF downloads
β
βββ π Run Scripts:
β βββ run_server.sh # Start legacy server (interactive)
β βββ run_headless.sh # Start legacy server (headless)
β
βββ π .gitignore # Git ignore rules
β
βββ π logs/ # All download logs
βββ model_downloads.log
βββ model_download_failures.log
βββ gguf_downloads.log
βββ ... (other log files)
1. Install vLLM (one-time, takes ~15 minutes):
./install_vllm.sh
2. Run vLLM server:
# NVFP4 model (best performance, ~16GB RAM)
./run_vllm.sh nvidia/Gemma-4-31B-IT-NVFP4 8000
# Or standard model (~20GB RAM)
./run_vllm.sh google/gemma-4-E4B-it 8000
If you already have your own vLLM Python environment, point the launcher to it:
VLLM_PYTHON=/path/to/python ./run_vllm.sh nvidia/Gemma-4-31B-IT-NVFP4 8000
You can also control launcher defaults with a local .env file:
VLLM_MODEL=nvidia/Gemma-4-31B-IT-NVFP4
VLLM_PORT=1111
VLLM_MAX_MODEL_LEN=32768
VLLM_GPU_MEMORY_UTILIZATION=0.60
VLLM_ENFORCE_EAGER=true
Then start with:
./run_vllm.sh
CLI arguments still win over .env values.
3. Test it:
curl http://localhost:8000/v1/chat/completions -H "Content-Type: application/json" -d '{
"messages": [{"role": "user", "content": "Hello!"}],
"stream": false
}'
# Interactive mode (model selection menu)
./run_server.sh
# Headless mode with specific model
./run_headless.sh google/gemma-4-E4B-it 1111
# Download NVFP4 models (recommended for vLLM)
./download_models.sh
# Download GGUF models
./download_gguf.sh
tools / tool_calls)messages like [{\"role\":\"user\",\"content\":\"hello\"}])For reasoning-capable models (for example Gemma 4 and Qwen 3), the OpenAI chat stream can emit short visible [thinking] ... status messages as normal content chunks so simple clients such as VS Code can show progress while the model is still reasoning.
tools / tool_calls response format)readFiles, editFiles)readFiles, editFiles)Set tool sandbox root (optional, defaults to server start directory):
export LLM_TOOL_ROOT=/home/sna/ai-projects
List tools:
curl http://localhost:11434/api/tools
Read files:
curl -X POST http://localhost:11434/api/tools/execute \
-H "Content-Type: application/json" \
-d '{"tool":"readFiles","arguments":{"paths":["property-crawler/README.md"]}}'
Edit files (find/replace):
curl -X POST http://localhost:11434/api/tools/execute \
-H "Content-Type: application/json" \
-d '{"tool":"editFiles","arguments":{"edits":[{"path":"property-crawler/README.md","find":"Quick Start","replace":"Quick Start (Updated)","all":false}]}}'
| Model | Size | vLLM Command |
|---|---|---|
| Gemma-4-31B-IT-NVFP4 | ~16GB | ./run_vllm.sh nvidia/Gemma-4-31B-IT-NVFP4 |
| Gemma-4-26B-A4B-it-NVFP4 | ~16GB | ./run_vllm.sh bg-digitalservices/Gemma-4-26B-A4B-it-NVFP4 |
| Qwen2.5-VL-7B-NVFP4 | ~12GB | ./run_vllm.sh nvidia/Qwen2.5-VL-7B-Instruct-NVFP4 |
| MiniMax-M2.5-NVFP4 | ~20GB | ./run_vllm.sh nvidia/MiniMax-M2.5-NVFP4 |
| Model | Size | Legacy Command |
|---|---|---|
| Gemma-4-E2B-it | ~8GB | ./run_headless.sh google/gemma-4-E2B-it |
| Gemma-4-E4B-it | ~25GB | ./run_headless.sh google/gemma-4-E4B-it |
| Qwen3-4B | ~12GB | ./run_headless.sh Qwen/Qwen3-4B |
| Qwen3-8B | ~18GB | ./run_headless.sh Qwen/Qwen3-8B |
| Qwen2.5-Coder-7B-Instruct | ~14GB | ./run_headless.sh Qwen/Qwen2.5-Coder-7B-Instruct |
All models are downloaded to ~/.cache/huggingface/hub and cached locally.
install_vllm.sh)Virtual environment for legacy server: /home/sna/ai-projects/model-gemma-4/myenv/
| Model | RAM Usage | Speed |
|---|---|---|
| Gemma-4-31B-IT-NVFP4 | ~16 GB | ~50 tok/s |
| Gemma-4-26B-A4B-it-NVFP4 | ~16 GB | ~52 tok/s |
| Qwen2.5-VL-7B-NVFP4 | ~12 GB | ~60 tok/s |
| Model | RAM Usage | Speed |
|---|---|---|
| Gemma-4-E2B-it | ~8 GB | ~15 tok/s |
| Gemma-4-E4B-it | ~25 GB | ~10 tok/s |
| Gemma-4-26B-A4B-it | ~45 GB | ~5 tok/s |
Total system RAM: 128 GB β all models fit comfortably with vLLM.
# Find the process
ps aux | grep vllm_server # or llm_server
# Kill it
kill <PID>
The GB10 GPU has compute capability 12.1 (sm_121) which is newer than most PyTorch/vLLM binary releases (max sm_120). This causes two issues:
Triton bundles ptxas 12.8 which cannot compile for sm_121a.
The fix is already applied automatically by run_vllm.sh and vllm_server.py:
export TRITON_PTXAS_PATH=/usr/local/cuda/bin/ptxas # uses system CUDA 13.0
If vLLM still crashes with CUDA kernel errors after the Triton fix, install a PyTorch wheel built with native sm_121 kernels:
./fix_pytorch_sm121.sh
This installs a community-built PyTorch from Qanatpharma/pytorch-sm121-gb10.
If startup fails with:
PyTorch and torchvision were compiled with different CUDA major versions
install matching packages in the same env:
pip install --force-reinstall --index-url https://download.pytorch.org/whl/cu130 torchvision torchaudio
For a battle-tested full stack (PyTorch + Triton + bitsandbytes + vLLM Docker):
"stream": true for token-by-token outputAll download logs are stored in the logs/ directory:
model_downloads.log - NVFP4 download progress and resultsmodel_download_failures.log - Failed downloads with error messagesgguf_downloads.log - GGUF download progress and resultsllm_runtime_port_<port>.log - live API request/response generation logs for both servers, including startup model info, prompt previews, streamed chunks, and completion summaries1 commits
Python
87.1%
Shell
12.9%
Complete LLM server setup for DGX Spark (128GB RAM, Blackwell GB10). All files are organized in this folder.
llm_server/
βββ π vLLM Servers (RECOMMENDED):
β βββ vllm_server.py # vLLM-optimized server (2-3x faster, 50% less RAM)
β βββ install_vllm.sh # Install vLLM in isolated environment
β βββ run_vllm.sh # Quick launcher for vLLM server
β
βββ π Legacy Server (HuggingFace):
β βββ llm_server.py # Original transformers-based server
β
βββ π Documentation:
β βββ README.md # This file
β βββ LLM_SERVER_README.md # Original usage documentation
β
βββ π₯ Download Scripts:
β βββ download_nvfp4_models.py # NVFP4 models downloader (cache-aware)
β βββ download_nvfp4_models.sh # NVFP4 downloader (hf CLI)
β βββ download_gguf_models.py # GGUF quantized models downloader
β βββ download_gguf_models.sh # GGUF downloader (hf CLI)
β βββ download_models.sh # Quick wrapper for NVFP4 downloads
β βββ download_gguf.sh # Quick wrapper for GGUF downloads
β
βββ π Run Scripts:
β βββ run_server.sh # Start legacy server (interactive)
β βββ run_headless.sh # Start legacy server (headless)
β
βββ π .gitignore # Git ignore rules
β
βββ π logs/ # All download logs
βββ model_downloads.log
βββ model_download_failures.log
βββ gguf_downloads.log
βββ ... (other log files)
1. Install vLLM (one-time, takes ~15 minutes):
./install_vllm.sh
2. Run vLLM server:
# NVFP4 model (best performance, ~16GB RAM)
./run_vllm.sh nvidia/Gemma-4-31B-IT-NVFP4 8000
# Or standard model (~20GB RAM)
./run_vllm.sh google/gemma-4-E4B-it 8000
If you already have your own vLLM Python environment, point the launcher to it:
VLLM_PYTHON=/path/to/python ./run_vllm.sh nvidia/Gemma-4-31B-IT-NVFP4 8000
You can also control launcher defaults with a local .env file:
VLLM_MODEL=nvidia/Gemma-4-31B-IT-NVFP4
VLLM_PORT=1111
VLLM_MAX_MODEL_LEN=32768
VLLM_GPU_MEMORY_UTILIZATION=0.60
VLLM_ENFORCE_EAGER=true
Then start with:
./run_vllm.sh
CLI arguments still win over .env values.
3. Test it:
curl http://localhost:8000/v1/chat/completions -H "Content-Type: application/json" -d '{
"messages": [{"role": "user", "content": "Hello!"}],
"stream": false
}'
# Interactive mode (model selection menu)
./run_server.sh
# Headless mode with specific model
./run_headless.sh google/gemma-4-E4B-it 1111
# Download NVFP4 models (recommended for vLLM)
./download_models.sh
# Download GGUF models
./download_gguf.sh
tools / tool_calls)messages like [{\"role\":\"user\",\"content\":\"hello\"}])For reasoning-capable models (for example Gemma 4 and Qwen 3), the OpenAI chat stream can emit short visible [thinking] ... status messages as normal content chunks so simple clients such as VS Code can show progress while the model is still reasoning.
tools / tool_calls response format)readFiles, editFiles)readFiles, editFiles)Set tool sandbox root (optional, defaults to server start directory):
export LLM_TOOL_ROOT=/home/sna/ai-projects
List tools:
curl http://localhost:11434/api/tools
Read files:
curl -X POST http://localhost:11434/api/tools/execute \
-H "Content-Type: application/json" \
-d '{"tool":"readFiles","arguments":{"paths":["property-crawler/README.md"]}}'
Edit files (find/replace):
curl -X POST http://localhost:11434/api/tools/execute \
-H "Content-Type: application/json" \
-d '{"tool":"editFiles","arguments":{"edits":[{"path":"property-crawler/README.md","find":"Quick Start","replace":"Quick Start (Updated)","all":false}]}}'
| Model | Size | vLLM Command |
|---|---|---|
| Gemma-4-31B-IT-NVFP4 | ~16GB | ./run_vllm.sh nvidia/Gemma-4-31B-IT-NVFP4 |
| Gemma-4-26B-A4B-it-NVFP4 | ~16GB | ./run_vllm.sh bg-digitalservices/Gemma-4-26B-A4B-it-NVFP4 |
| Qwen2.5-VL-7B-NVFP4 | ~12GB | ./run_vllm.sh nvidia/Qwen2.5-VL-7B-Instruct-NVFP4 |
| MiniMax-M2.5-NVFP4 | ~20GB | ./run_vllm.sh nvidia/MiniMax-M2.5-NVFP4 |
| Model | Size | Legacy Command |
|---|---|---|
| Gemma-4-E2B-it | ~8GB | ./run_headless.sh google/gemma-4-E2B-it |
| Gemma-4-E4B-it | ~25GB | ./run_headless.sh google/gemma-4-E4B-it |
| Qwen3-4B | ~12GB | ./run_headless.sh Qwen/Qwen3-4B |
| Qwen3-8B | ~18GB | ./run_headless.sh Qwen/Qwen3-8B |
| Qwen2.5-Coder-7B-Instruct | ~14GB | ./run_headless.sh Qwen/Qwen2.5-Coder-7B-Instruct |
All models are downloaded to ~/.cache/huggingface/hub and cached locally.
install_vllm.sh)Virtual environment for legacy server: /home/sna/ai-projects/model-gemma-4/myenv/
| Model | RAM Usage | Speed |
|---|---|---|
| Gemma-4-31B-IT-NVFP4 | ~16 GB | ~50 tok/s |
| Gemma-4-26B-A4B-it-NVFP4 | ~16 GB | ~52 tok/s |
| Qwen2.5-VL-7B-NVFP4 | ~12 GB | ~60 tok/s |
| Model | RAM Usage | Speed |
|---|---|---|
| Gemma-4-E2B-it | ~8 GB | ~15 tok/s |
| Gemma-4-E4B-it | ~25 GB | ~10 tok/s |
| Gemma-4-26B-A4B-it | ~45 GB | ~5 tok/s |
Total system RAM: 128 GB β all models fit comfortably with vLLM.
# Find the process
ps aux | grep vllm_server # or llm_server
# Kill it
kill <PID>
The GB10 GPU has compute capability 12.1 (sm_121) which is newer than most PyTorch/vLLM binary releases (max sm_120). This causes two issues:
Triton bundles ptxas 12.8 which cannot compile for sm_121a.
The fix is already applied automatically by run_vllm.sh and vllm_server.py:
export TRITON_PTXAS_PATH=/usr/local/cuda/bin/ptxas # uses system CUDA 13.0
If vLLM still crashes with CUDA kernel errors after the Triton fix, install a PyTorch wheel built with native sm_121 kernels:
./fix_pytorch_sm121.sh
This installs a community-built PyTorch from Qanatpharma/pytorch-sm121-gb10.
If startup fails with:
PyTorch and torchvision were compiled with different CUDA major versions
install matching packages in the same env:
pip install --force-reinstall --index-url https://download.pytorch.org/whl/cu130 torchvision torchaudio
For a battle-tested full stack (PyTorch + Triton + bitsandbytes + vLLM Docker):
"stream": true for token-by-token outputAll download logs are stored in the logs/ directory:
model_downloads.log - NVFP4 download progress and resultsmodel_download_failures.log - Failed downloads with error messagesgguf_downloads.log - GGUF download progress and resultsllm_runtime_port_<port>.log - live API request/response generation logs for both servers, including startup model info, prompt previews, streamed chunks, and completion summaries1 commits
Python
87.1%
Shell
12.9%