gpu-advisor
Skill13 starsChanged 7 months agoMITView on GitHub
Detect local GPU hardware and recommend optimal llama.cpp model + KV cache configuration. Supports AMD (ROCm) and NVIDIA (CUDA). Recommends TurboQuant KV compression when standard f16 cache won't fit.
In this repository3 other files it gives its agents.
- bitwardenSkill
- email-himalayaSkill
- skill-autoresearchSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 112
VRAM Safety: Do not exceed 90% of free VRAM.
- Distinctive: line 114
Driver Integrity: Ensure ROCm/CUDA drivers match GPU architecture to avoid kernel panics.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
GPU Advisor — Local Inference Optimization
Detect your GPU and get actionable recommendations for running LLMs locally with llama.cpp.
When to Use
- User asks "what model can I run on my GPU?"
- User asks "will this model fit in my VRAM?"
- User is getting OOM errors with llama.cpp
- User wants to maximize context length on their hardware
- User asks about KV cache quantization or TurboQuant
Prerequisites
- AMD GPU:
rocm-smiavailable (ROCm installed)- Verify:
rocm-smi --showinfo
- Verify:
- NVIDIA GPU:
nvidia-smiavailable (CUDA drivers installed)- Verify:
nvidia-smi
- Verify:
- Python 3.8+ (stdlib only, no dependencies)
- Verify:
python3 --version
- Verify:
Commands
Detect GPU
python3 scripts/gpu_advisor.py detectReturns: GPU name, arch, VRAM total/used/free, driver version, compute platform.
Recommend model configuration
python3 scripts/gpu_advisor.py recommend --model Qwen3.5-27B --quant Q5_K_MReturns: whether it fits, recommended KV cache type (f16/q8_0/q4_0/turbo3/turbo4), max context length.
Check if a specific config fits
python3 scripts/gpu_advisor.py check --model-size 18.5 --ctx 80000 --kv-type turbo3Returns: VRAM breakdown (model + KV + overhead), fit/no-fit verdict.
How It Works
The advisor uses a simple VRAM budget model:
Total VRAM = Model weights + KV cache + Compute overhead (~500MB)
KV cache size = 2 × n_layers × n_kv_heads × head_dim × ctx_length × bytes_per_element
f16: 2 bytes/element (baseline)
q8_0: 1 byte/element (2× compression)
q4_0: 0.5 bytes/element (4× compression)
turbo3: 0.375 bytes/element (5.3× compression)
turbo4: 0.25 bytes/element (8× compression)For SWA models (Gemma 4), the advisor recommends f16 on SWA layers + turbo on global layers, because turbo on SWA causes catastrophic quality loss.
Example Output
GPU: AMD Radeon RX 7900 XTX (gfx1100)
VRAM: 24576 MiB total, 22891 MiB free
Platform: ROCm 6.4
Model: Qwen3.5-27B Q5_K_M (18.5 GiB)
Context: 80,000 tokens
KV type | KV size | Total VRAM | Fits? | Max context
----------|----------|------------|-------|------------
f16 | 5,120 MB | 24,444 MB | NO | ~62K
q4_0 | 1,280 MB | 20,604 MB | YES | ~250K
turbo3 | 960 MB | 20,284 MB | YES | ~330K
turbo4 | 640 MB | 19,964 MB | YES | ~500K
Recommendation: turbo3 — best quality/compression tradeoff.
llama-server -m model.gguf -ngl 99 --ctx-size 80000 \
--cache-type-k turbo3 --cache-type-v turbo3Known Model Profiles
The advisor includes VRAM profiles for popular models:
| Model | Params | Q4_K_M | Q5_K_M | Q8_0 | Layers | KV heads | Head dim |
| Qwen3.5-9B | 9B | 5.5G | 6.6G | 9.5G | 40 | 8 | 128 |
| Qwen3.5-27B | 27B | 15.3G | 18.5G | 27.2G | 64 | 8 | 128 |
| Gemma-4-26B-A4B | 26B | 15.9G | — | — | 50 | 4 | 256 |
| Llama-3.1-8B | 8B | 4.9G | 5.7G | 8.5G | 32 | 8 | 128 |
Guardrails
- VRAM Safety: Do not exceed 90% of free VRAM; OOM errors may crash system processes.
- Thermal Limits: Monitor GPU temperatures during long context inference to prevent throttling.
- Driver Integrity: Ensure ROCm/CUDA drivers match GPU architecture to avoid kernel panics.
- Model Verification: Validate GGUF checksums to prevent loading corrupted weights.
Limitations
- SWA detection is based on known model names, not parsed from GGUF metadata
- Model size database covers popular models; unknown models need
--model-sizeviacheckcommand - TurboQuant requires a compatible llama.cpp build (upstream or domvox/llama.cpp-turboquant-hip)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

