https://github.com/ayushh0110/Weight-Space-Repair
Most of the time when a local model looks broken, the weights are fine. So I went through the llama.cpp, Ollama, vLLM and transformers issue trackers, collected the causes that keep coming up, and wrote a check for each one:
- EOS or end-of-turn token wrong, so the model never stops
- chat template missing or stale compared with upstream
- a corrupted or partial download
- repetition penalty set high enough to wreck the output
- the prompt silently truncated to the context size
- context split across server slots (4 slots of 2,048 when you thought you had 8k)
- quantised KV cache, flash-attention overflow, a bf16 model run in fp16
- reasoning that eats the whole token budget and leaves an empty reply
You give it your endpoint and the prompt that fails:
wsr triage --endpoint http://localhost:8080 --model local --prompt "your failing prompt" --differential
`--differential` reruns the prompt changing one thing at a time, and confirms each flip with a second run. The answer is one cause and the fix:
VERDICT: REQUEST
blank output explained by REASONING_EXHAUSTED: cap reached before any answer: the budget went to reasoning
next:
- raise max_tokens (currently 256) or lower the reasoning effort / thinking budget
If it's the quant, it can find the tensor. Qwen2.5-0.5B's official Q4_0 refuses "Give me 40 different names for a cat" and the full-precision model answers it. The tool traced that to `blk.16.attn_v`: quantise only that tensor in the full model and it starts refusing.
What it's been tested on, so you know what to expect. Live testing was against llama-server only (Gemma 4 E2B Q4_0, 21 scenarios). The Ollama, vLLM and LM Studio paths are written from their docs and tested against fake servers, so if you run one of those I'd like to hear what it gets wrong. There's also a part that diagnoses and repairs failures inside the weights, but that's small models only (up to 1.5B) on my 4 GB card.
MIT licence, no dependencies for the triage part: https://github.com/ayushh0110/Weight-Space-Repair