RustMentor-0.6B-GGUF
RustMentor-0.6B-GGUF is a 0.6B-parameter Qwen3-based model fine-tuned for Rust programming education and code review. It merges the base model with LoRA adapters and includes GGUF quantization for local/mobile/Ollama workflows.
This repository hosts the GGUF quantized model (Q4_K_M) for lightweight inference. For the LoRA adapter, see rust-mentor-0.6b.
Model Description
- Base Model: Qwen/Qwen3-0.6B
- Model Type: Causal LM (code tutoring + review)
- Parameters: 0.6B
- Context Length: 2048 tokens
- Fine-tuning: QLoRA (r=8, alpha=8) with Unsloth optimization
- Quantization: Q4_K_M (~0.4GB)
- License: Apache 2.0
- Language: English, Rust code
- System Prompt: Rust programming tutor for experienced Go/Python/TypeScript developers learning Rust by building CLI tools.
What It Is Good At
- Explaining Rust ownership, borrowing, and lifetimes with Go/Python/TS comparisons
- Code review with borrow checker explanations
- Error handling patterns (Result, Option, ?, thiserror, anyhow)
- Async/await and Tokio patterns
- Smart pointers (Box, Rc, Arc, RefCell)
- Pattern matching and enum-based design
- Trait-based architecture and generics
- Type conversions (From, Into, AsRef, Deref)
- Serde & JSON serialization
- CLI tooling with clap
- Cargo project structure, modules, and workspaces
- Testing patterns and documentation
Intended Uses
Primary: Offline Rust programming tutor on Android (Pixel 8 Pro tested) via PocketPal AI, or local inference via Ollama/llama.cpp.
Out-of-scope: General-purpose chat, non-Rust programming, safety-sensitive or factual tasks outside Rust development.
Prompt Examples
"In Go, I just pass values or pointers. What's this ownership thing in Rust?"
"Review this Rust code and explain what the borrow checker is doing:\n\nfn get_longest(a: String, b: String) -> String {\n if a.len() > b.len() { a } else { b }\n}"
"How do I handle errors in Rust? I'm used to Go's if err != nil pattern."
"How does async work in Rust? In Go I just use goroutines and it's simple."
How to Use
PocketPal AI (Android — Offline)
- Install PocketPal AI from Play Store
- Tap "Add from Hugging Face"
- Search:
sylvester-francis/rust-mentor-0.6b-GGUF - Download the Q4_K_M quantization (~0.4GB)
- Create a "Pal" with the Rust tutor system prompt
- Enable airplane mode and start learning!
Ollama (Local)
# Download the GGUF
huggingface-cli download sylvester-francis/rust-mentor-0.6b-GGUF \
--local-dir ./models/rust-mentor
# Create Modelfile
cat > Modelfile << 'MODELFILE'
FROM ./models/rust-mentor/<gguf-filename>.gguf
SYSTEM """You are RustMentor, an expert Rust programming tutor. The student is an experienced Go, Python, and TypeScript developer learning Rust by building CLI tools. Draw parallels to Go/Python/TypeScript concepts. Explain ownership, borrowing, and lifetimes with practical examples."""
PARAMETER temperature 0.7
PARAMETER top_p 0.9
PARAMETER num_ctx 2048
MODELFILE
ollama create rust-mentor -f Modelfile
ollama run rust-mentor "Explain Rust's ownership vs Go's garbage collector"
llama.cpp
huggingface-cli download sylvester-francis/rust-mentor-0.6b-GGUF \
--local-dir ./models
./llama-cli -m ./models/<gguf-filename>.gguf \
-p "Explain and fix this Rust borrow checker error..."
Training Data (Summary)
- Strandset-Rust-v1: 3,000 samples of Rust code generation, review, refactoring, and bug detection tasks
- Synthetic tutor conversations: 46 unique hand-crafted Rust tutoring dialogues across 28 topics, covering ownership, error handling, traits, async, smart pointers, macros, serde, testing, and more
- Style: All conversations draw parallels to Go/Python/TypeScript equivalents
Training Configuration (QLoRA)
| Parameter | Value |
|---|---|
| Base Model | Qwen/Qwen3-0.6B |
| Method | QLoRA via Unsloth |
| LoRA Rank (r) | 8 |
| LoRA Alpha | 8 |
| Target Modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| Epochs | 3 |
| Batch Size | 4 x 2 (effective 8) |
| Learning Rate | 2e-4 (cosine schedule) |
| Max Sequence Length | 2048 |
| Hardware | NVIDIA A100 40GB (Google Colab) |
Evaluation
Qualitative checks on Rust tutoring prompts show:
- Clear explanations with Go/Python/TypeScript comparisons
- Accurate code examples with proper ownership and borrowing
- Borrow checker explanations in code reviews
- Appropriate use of idiomatic Rust patterns
Safety & Limitations
- May generate incorrect code or hallucinate crate APIs — review before production use.
- Not a replacement for the Rust compiler or clippy — always compile and test generated code.
- Optimized for tutoring, not production code generation at scale.
- Training data focuses on CLI/systems patterns; web framework coverage (Axum, Actix) is limited.
License
Apache 2.0 for the fine-tuned model; base model (Qwen/Qwen3-0.6B) license also applies.
Contact
- Maintainer: Sylvester Francis (@sylvester-francis)
- Repository: github.com/sylvester-francis/slm-rust-model
- Issues/feedback: Open a discussion on the model repo
- Downloads last month
- 101
Hardware compatibility
Log In to add your hardware
4-bit