clanker
generates llama-server commands so you don't have to guess how many layers fit on your gpu. reads the gguf header, does the math, prints the command.
i got tired of trial-and-error vram tuning for moe models on consumer gpus.
Setup
requires python 3.10+ and pip.
pip install clanker-gguf
or install from source:
pip install git+https://github.com/Stavros-alt/clanker.git
pip install "git+https://github.com/Stavros-alt/clanker.git#egg=clanker-gguf[all]"
or clone and install locally:
git clone https://github.com/Stavros-alt/clanker.git
cd clanker
pip install -e ".[all]"
you also need:
nvidia-smion PATH (cpu-only mode works without it)llama-serverfrom ik_llama.cpp (build it withclanker build, or install manually)- windows? good luck. this probably works on wsl.
Usage
clanker run <model>
clanker run ~/models/qwen.gguf # direct path
clanker run qwen # fuzzy cache search
clanker run qwen.gguf --preset speed # apply a preset
clanker run qwen.gguf --context 65536 # override context
clanker run qwen.gguf --execute # run it
defaults to 8K context, q8_0 KV cache, no flash attention.
pass --preset big-brain for the optimized 128k config.
clanker download <repo>
clanker download unsloth/Qwen3.6-35B-A3B-GGUF # scan only
clanker download unsloth/Qwen3.6-35B-A3B-GGUF --execute # download
clanker download unsloth/Qwen3.6-35B-A3B-GGUF -c 32768 # budget for 32k ctx
picks the highest-quality quant that fits your ram, with preference for
models whose backbone fits on gpu. --fit handles the offloading at
runtime.
quality warnings: if the best available quant is below IQ4_XS (the kneedle knee point from KLD benchmarks), clanker aborts and tells you to use a smaller model or a different repo. accuracy drops off a cliff below IQ4_XS (78.4% top-1 @ 16.4 gb).
unsloth _XL warning: some unsloth _XL quants contain f16 tensors that crash ik_llama.cpp. clanker warns and lets you filter out the _risky quant to pick the next best.
Other commands
clanker discover # scan hf cache for gguf models
clanker discover --json # json output
clanker ls # alias for discover
clanker search # open hf search with hardware-tuned bounds
clanker presets # list all presets with their settings
clanker build # clone and compile ik_llama.cpp
clanker search caps results by vram budget at IQ4_XS quality.
if your kv cache eats all the vram (128k ctx on 12gb cards),
it warns that models will offload entirely to ram.
Presets
all presets enable mtp speculative decoding when the model supports it.
| Name | Context | KV Cache | Notes |
|---|---|---|---|
big-brain |
128K | k=q8_0, v=q5_1 | mlock, no-mmap, flash-attn |
speed |
32K | k=q6_0, v=q5_0 | mlock, flash-attn |
infinite |
512K | k=q5_0, v=q4_1 | no-mmap, flash-attn |
coding |
64K | k=q8_0, v=q5_1 | mlock, flash-attn, temp=0.2 |
kv cache quants are from KLD benchmarks (anbeeld). mixed k/v pairs outperform symmetric ones on the pareto frontier.
How it works
- reads your gpu vram via nvidia-smi
- detects physical cpu cores (uses cores - 1 for thread count)
- parses the gguf header for architecture, layers, experts, quant type
- figures out layer split, kv cache size, fit-margin based on available vram
- spits out a llama-server command with thread tuning, ubatch tuning, and mlock
Notes
--fit --fit-margin Nmeans "keep N MB of vram free". base is 1664 for ik_llama, 4608 for mainline. mtp adds 2048 mb overhead.- thread count is
physical_cores - 1(min 1). keeps one core free for gpu scheduling and os tasks. -ub 2048sets the micro-batch size for max memory-bandwidth utilization during prompt prefill.- mtp flags are only added when the model file has "mtp" in its name.
- the downloader tries
llama-cli -hffirst, falls back tohuggingface_hub. if llama-cli downloads then ooms, clanker detects the existing file and skips re-download. - quantization detection from gguf metadata is unreliable (returns int enums). filenames are more accurate, so clanker parses the filename.
- combined expert tensors (qwen3, deepseek) are handled by dividing total size by expert_count from metadata.
--backend llamaswitches to mainline llama.cpp flags (spec-type, spec-draft-n-max, etc). default is ik_llama.
Metadata
Release files for clanker-gguf 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| clanker_gguf-1.2.0.tar.gz | 32.1 kB | With provenance | Details for clanker_gguf-1.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| clanker_gguf-1.2.0-py3-none-any.whl | Python 3 | none | any | Details for clanker_gguf-1.2.0-py3-none-any.whl |
Total release size: 60.4 kB
Release files / clanker_gguf-1.2.0.tar.gz
| Download URL | clanker_gguf-1.2.0.tar.gz |
|---|---|
| Size | 32.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7f3d65b9f9d7342c3616265b53f87e80da3b023f0ffc09b772612bcf3439f59d
|
|
BLAKE2b-256 checksum How to use checksums |
4224d61c24149370963a47d50937ce6c40109534c63fa3b9ec65cd9413265e52
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 7, 2026.
Transparency logRelease files / clanker_gguf-1.2.0-py3-none-any.whl
| Download URL | clanker_gguf-1.2.0-py3-none-any.whl |
|---|---|
| Size | 28.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8c4909bc078b22b9dd3f4f2a4f0569105e3328c4cf556e66e245c5a858c38a6f
|
|
BLAKE2b-256 checksum How to use checksums |
c8893a5118ea16cc76b95ef57d28b6ccace079b5388ac7b3a8f1707d83a7505f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 7, 2026.
Transparency logSecurity for clanker-gguf 1.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for clanker_gguf-1.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 7, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.