RustMentor 4B โ€” GGUF (Q4_K_M)

A Rust programming tutor fine-tuned from Gemma 3 4B-IT. Teaches Rust by drawing comparisons to Python, Go, and TypeScript.

Model Details

Base model google/gemma-3-4b-it
Fine-tuning QLoRA (r=16, alpha=16) via Unsloth + TRL
Quantization Q4_K_M (k-quant mixed precision via llama.cpp)
Size ~2.5 GB
Format GGUF (compatible with llama.cpp, PocketPal AI, Maid)
License Gemma

Intended Use

Offline Android coding tutor for developers learning Rust. The model:

  • Explains Rust concepts using parallels to Python, Go, and TypeScript
  • Covers ownership, borrowing, lifetimes, traits, error handling, async, and more
  • Refuses out-of-domain questions (non-Rust topics)
  • Resists prompt injection attempts

How to Run

PocketPal AI (Android): Download from the Play Store, then load this model from the HF Hub.

llama.cpp (CLI):

./llama-cli -m rust-mentor-4b-Q4_K_M.gguf -p "<start_of_turn>user
Explain ownership in Rust<end_of_turn>
<start_of_turn>model
"

Training Data

Fine-tuned on 500 samples covering:

  • 16 Rust teaching conversations (ownership, borrowing, lifetimes, traits, enums, pattern matching, async, iterators, structs, strings, serde, cargo, error handling, testing, memory model)
  • 10 out-of-domain refusal examples (Java, C++, Ruby, cooking, math, etc.)
  • 9 prompt injection hardening examples (persona override, instruction extraction, jailbreak roleplay, encoded bypass, etc.)

Limitations

  • Focused exclusively on Rust โ€” will refuse other programming languages
  • Comparisons are anchored to Python, Go, and TypeScript only
  • 4B model may occasionally produce less precise answers than 8B+ models
  • Q4_K_M quantization may reduce quality on nuanced reasoning tasks
Downloads last month
179
GGUF
Model size
4B params
Architecture
qwen3
Hardware compatibility
Log In to add your hardware

4-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for sylvester-francis/rust-mentor-4b-GGUF

Quantized
(491)
this model