LoRA adapter that teaches Qwen3.5-0.8B the agentic tool-routing skill from
the wcag-skill: while running
the AI-WCAG-Gauntlet benchmark
loop, pick the right validator (w3c / axe / pa11y / qualweb / fix /
check) and run a self-check on your own code before the benchmark's
official iteration check.
Files in this repo: PEFT LoRA adapter (adapter_model.safetensors) + merged
Q4_K_M GGUF (qwen3.5-0.8b-wcag-gauntlet-lora-q4_k_m.gguf, 505 MB) ready for
Ollama / llama.cpp. 100% tool-routing accuracy on 155 held-out rows.
| Metric | Base Qwen3.5-0.8B | After LoRA |
|---|---|---|
next_tool (6-way validator routing) |
0% (emits prose, no tool-use) | 100% |
run_precheck (self-check yes/no) |
6.5% | 100% |
Val split (40 rows): 100% / 100% after 2 epochs.
q/k/v/o_proj +
gate/up/down_proj (12.8M trainable params, 1.67% of 765M)test-suite.sh (W3C validator + axe + pa11y + QualWeb + tag coverage,
Chrome for Testing), expanded with tag-coverage variants, post-fix variants
and edge cases. Gold labels derived from validator flags per the wcag-skill
triage rules.hummern/lora-tooluse-skill-v7)user … assistant),
answer = <tool>\n<yes|no>A rank-1 MEMIT column edit on layer-23 down_proj (same method that works for
factual WCAG Q&A) scored 6.5% on this task — below the 16.7% random floor.
Tool routing is procedural, not a factual logit gap; only gradient-based LoRA
transferred it.
A merged Q4_K_M GGUF (505 MB) is included in this repo:
# Download the GGUF directly
hf download Turbolego/qwen3.5-0.8b-wcag-gauntlet-lora \
qwen3.5-0.8b-wcag-gauntlet-lora-q4_k_m.gguf --local-dir ./
# Ollama Modelfile
cat > Modelfile <<'EOF'
FROM ./qwen3.5-0.8b-wcag-gauntlet-lora-q4_k_m.gguf
TEMPLATE """{{- if .System }}{{ .System }}{{ end }}
{{- range .Messages }}{{ .Role }}: {{ .Content }}
{{- end }}
assistant: """
PARAMETER stop "user:"
PARAMETER stop "assistant:"
EOF
ollama create qwen-gauntlet -f Modelfile
ollama run qwen-gauntlet "State: w3c_errors=2. Which validator next? Format: <word>\\n<yes|no>"
# expected: w3c \n yes
Note: this repo now ships both the PEFT LoRA adapter and a merged Q4_K_M GGUF — use the GGUF directly with Ollama/llama.cpp (see Usage above), or merge the adapter yourself (steps 1–3 below).
# adapter (this repo)
hf download Turbolego/qwen3.5-0.8b-wcag-gauntlet-lora --local-dir ./gauntlet-lora
# base model (needed to merge)
hf download Qwen/Qwen3.5-0.8B --local-dir ./qwen-base
pip install torch transformers peft llama-cpp-python # + build llama.cpp for convert script
python - <<'PY'
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
tok = AutoTokenizer.from_pretrained("./qwen-base")
base = AutoModelForCausalLM.from_pretrained("./qwen-base", torch_dtype="auto")
model = PeftModel.from_pretrained(base, "./gauntlet-lora")
merged = model.merge_and_unload()
merged.save_pretrained("./qwen-gauntlet-merged")
tok.save_pretrained("./qwen-gauntlet-merged")
PY
# convert to GGUF (llama.cpp)
git clone https://github.com/ggerganov/llama.cpp && cd llama.cpp && make -j
python convert_hf_to_gguf.py ../qwen-gauntlet-merged --outfile ../qwen-gauntlet-q4.gguf --outtype q4_k_m
Modelfile:
FROM ./qwen-gauntlet-q4.gguf
TEMPLATE """{{- if .System }}{{ .System }}{{ end }}
{{- range .Messages }}{{ .Role }}: {{ .Content }}
{{- end }}
assistant: """
PARAMETER stop "user:"
PARAMETER stop "assistant:"
ollama create qwen-gauntlet -f Modelfile
ollama run qwen-gauntlet "Which validator comes next if only axe violations remain? Answer:"
# expect: axe (then a yes/no line for the pre-check question)
Install the Continue (or Cline) extension.
In Continue settings (config.json) add Ollama as a provider:
{
"models": [{
"title": "qwen-gauntlet (Ollama)",
"provider": "ollama",
"model": "qwen-gauntlet"
}]
}
Select qwen-gauntlet in the Continue chat model picker. The model now
routes validator calls in the gauntlet loop.
qwen-gauntlet model
(or run the harness against the Ollama API: curl localhost:11434/api/chat).w3c → axe → pa11y → qualweb → fix
in triage order and answer yes to running a pre-check on its own edits.curl http://localhost:11434/api/chat -d '{
"model": "qwen-gauntlet",
"messages": [{"role": "user", "content": "State: w3c_errors=2, axe_violations=5, pa11y_issues=0, qualweb_issues=1, missing_tags=[nav]. Question 1: which validator or action comes next (w3c/axe/pa11y/qualweb/fix/check)? Question 2: run a pre-check on your own code? Format: <word>\\n<yes|no>"}],
"stream": false
}'
# expected answer: w3c \n yes
LORA_TOOLUSE_RESULTS.md, notebooks/lora_tooluse_skill.py)Qwen/Qwen3.5-0.8B