Instructions to use Nayrosk/rust-errors-qwen3-4b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Nayrosk/rust-errors-qwen3-4b with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-4B") model = PeftModel.from_pretrained(base_model, "Nayrosk/rust-errors-qwen3-4b") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Nayrosk/rust-errors-qwen3-4b with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf Nayrosk/rust-errors-qwen3-4b:Q4_K_M # Run inference directly in the terminal: llama cli -hf Nayrosk/rust-errors-qwen3-4b:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Nayrosk/rust-errors-qwen3-4b:Q4_K_M # Run inference directly in the terminal: llama cli -hf Nayrosk/rust-errors-qwen3-4b:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf Nayrosk/rust-errors-qwen3-4b:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf Nayrosk/rust-errors-qwen3-4b:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf Nayrosk/rust-errors-qwen3-4b:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf Nayrosk/rust-errors-qwen3-4b:Q4_K_M
Use Docker
docker model run hf.co/Nayrosk/rust-errors-qwen3-4b:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use Nayrosk/rust-errors-qwen3-4b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Nayrosk/rust-errors-qwen3-4b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Nayrosk/rust-errors-qwen3-4b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Nayrosk/rust-errors-qwen3-4b:Q4_K_M
- Ollama
How to use Nayrosk/rust-errors-qwen3-4b with Ollama:
ollama run hf.co/Nayrosk/rust-errors-qwen3-4b:Q4_K_M
- Unsloth Desktop
- Pi
How to use Nayrosk/rust-errors-qwen3-4b with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Nayrosk/rust-errors-qwen3-4b:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Nayrosk/rust-errors-qwen3-4b:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use Nayrosk/rust-errors-qwen3-4b with Docker Model Runner:
docker model run hf.co/Nayrosk/rust-errors-qwen3-4b:Q4_K_M
- Lemonade
How to use Nayrosk/rust-errors-qwen3-4b with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Nayrosk/rust-errors-qwen3-4b:Q4_K_M
Run and chat with the model
lemonade run user.rust-errors-qwen3-4b-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use Nayrosk/rust-errors-qwen3-4b with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Nayrosk/rust-errors-qwen3-4b:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default Nayrosk/rust-errors-qwen3-4b:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Nayrosk/rust-errors-qwen3-4b with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Nayrosk/rust-errors-qwen3-4b:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "Nayrosk/rust-errors-qwen3-4b:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Distilled with overbrainer
nayrosk/rust-errors-qwen3-4b
Qwen/Qwen3-4B fine-tuned (QLoRA) on 1746 questions answered by deepseek/deepseek-v4-pro:thinking.
Use it
ollama run hf.co/nayrosk/rust-errors-qwen3-4b:Q4_K_M
llama-cli -hf nayrosk/rust-errors-qwen3-4b:Q4_K_M
How it was made
overbrainer wrote questions on the topics below with the generator model, kept the parent model's answers, then fine-tuned the base model on them with Axolotl. The parent's reasoning was left out of training on purpose (chat_template = "chatml"): a run that also trained the reasoning made a 1.7B child think until it hit its token limit.
| Parent model | deepseek/deepseek-v4-pro:thinking |
| Generator model | deepseek/deepseek-v4-flash |
| Base model | Qwen/Qwen3-4B |
| Adapter | QLoRA |
| Examples | 1746 train, 194 eval |
| Epochs | 3 |
| Learning rate | 0.0002 |
| Sequence length | 4096 |
| Final loss | 1.04 train, 1.10 eval |
| Training time | 1 h 18 min |
Topics:
- borrow_checker: Rust borrow checker errors (E0499, E0502, E0505, E0506): what triggers each one and how to fix the code
- moves: Rust use-after-move and move-out-of-borrow errors (E0382, E0507, E0508): causes and fixes
- lifetimes: Rust lifetime errors (E0106, E0597, E0716, E0621, lifetime may not live long enough): causes and fixes
- traits: Rust trait bound and method resolution errors (E0277, E0599, E0038 object safety): causes and fixes
- types: Rust type mismatch and inference errors (E0308, E0282, E0283): causes and fixes
- mutability: Rust mutability errors (E0596, E0594, E0384) and interior mutability: causes and fixes
- generics: Rust generics and associated type errors (E0107, E0191, E0220, E0207): causes and fixes
- async_send: Rust async errors: futures that are not Send, holding guards across await, missing async runtime: causes and fixes
- modules: Rust visibility, import and module errors (E0603, E0432, E0433, E0425): causes and fixes
Trained on Runpod (NVIDIA A40) for about $0.81.
Results
Against the parent on 194 held-out questions, judged pairwise by a local qwen3.5:9b: the child wins or ties on 20.2% of them, with a p50 latency of 5.6 s on one RTX A5000, at about 6% of the parent's cost per request. It is a cheap first line, not a replacement for the parent on hard questions. The full case study, with a 1.7B comparison and its limits, is in the overbrainer repository (examples/rust-errors).
Reproduce
cargo install --locked overbrainer
With these sections of overbrainer.toml (project, providers, targets and keys left out), then overbrainer run:
[[topics]]
name = "borrow_checker"
description = "Rust borrow checker errors (E0499, E0502, E0505, E0506): what triggers each one and how to fix the code"
subtopics = 4
questions_per_subtopic = 55
[[topics]]
name = "moves"
description = "Rust use-after-move and move-out-of-borrow errors (E0382, E0507, E0508): causes and fixes"
subtopics = 4
questions_per_subtopic = 55
[[topics]]
name = "lifetimes"
description = "Rust lifetime errors (E0106, E0597, E0716, E0621, lifetime may not live long enough): causes and fixes"
subtopics = 4
questions_per_subtopic = 55
[[topics]]
name = "traits"
description = "Rust trait bound and method resolution errors (E0277, E0599, E0038 object safety): causes and fixes"
subtopics = 4
questions_per_subtopic = 55
[[topics]]
name = "types"
description = "Rust type mismatch and inference errors (E0308, E0282, E0283): causes and fixes"
subtopics = 4
questions_per_subtopic = 55
[[topics]]
name = "mutability"
description = "Rust mutability errors (E0596, E0594, E0384) and interior mutability: causes and fixes"
subtopics = 4
questions_per_subtopic = 55
[[topics]]
name = "generics"
description = "Rust generics and associated type errors (E0107, E0191, E0220, E0207): causes and fixes"
subtopics = 4
questions_per_subtopic = 55
[[topics]]
name = "async_send"
description = "Rust async errors: futures that are not Send, holding guards across await, missing async runtime: causes and fixes"
subtopics = 4
questions_per_subtopic = 55
[[topics]]
name = "modules"
description = "Rust visibility, import and module errors (E0603, E0432, E0433, E0425): causes and fixes"
subtopics = 4
questions_per_subtopic = 55
[roles.generator]
provider = "nanogpt"
model = "deepseek/deepseek-v4-flash"
reasoning = false
max_tokens = 16384
[roles.parent]
provider = "nanogpt"
model = "deepseek/deepseek-v4-pro:thinking"
reasoning = true
max_tokens = 16384
[roles.judge]
provider = "xana"
model = "qwen3.5:9b"
reasoning = false
max_tokens = 1024
reasoning_effort = "none"
[training]
base_model = "Qwen/Qwen3-4B"
adapter = "qlora"
epochs = 3
learning_rate = 0.0002
lora_r = 16
lora_alpha = 32
lora_dropout = 0.05
sequence_len = 4096
micro_batch_size = 2
gradient_accumulation_steps = 4
optimizer = "adamw_torch_fused"
lr_scheduler = "cosine"
sample_packing = true
evals_per_epoch = 4
saves_per_epoch = 1
merge = false
[training.axolotl_extra]
chat_template = "chatml"
[pipeline]
concurrency = 2
max_retries = 5
dedup_threshold = 0.8
eval_ratio = 0.1
seed = 42
include_system_prompt = false
embedding_threshold = 0.9
question_batch_size = 10
request_timeout_secs = 600
See the overbrainer docs.
overbrainer distills a big LLM into a small one from your terminal. If this model is useful, a star on GitHub helps.
- Downloads last month
- 53
4-bit
