Instructions to use sylvester-francis/rust-mentor-1.7b-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use sylvester-francis/rust-mentor-1.7b-GGUF 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 sylvester-francis/rust-mentor-1.7b-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf sylvester-francis/rust-mentor-1.7b-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf sylvester-francis/rust-mentor-1.7b-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf sylvester-francis/rust-mentor-1.7b-GGUF: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 sylvester-francis/rust-mentor-1.7b-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf sylvester-francis/rust-mentor-1.7b-GGUF: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 sylvester-francis/rust-mentor-1.7b-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf sylvester-francis/rust-mentor-1.7b-GGUF:Q4_K_M
Use Docker
docker model run hf.co/sylvester-francis/rust-mentor-1.7b-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use sylvester-francis/rust-mentor-1.7b-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sylvester-francis/rust-mentor-1.7b-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sylvester-francis/rust-mentor-1.7b-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/sylvester-francis/rust-mentor-1.7b-GGUF:Q4_K_M
- Ollama
How to use sylvester-francis/rust-mentor-1.7b-GGUF with Ollama:
ollama run hf.co/sylvester-francis/rust-mentor-1.7b-GGUF:Q4_K_M
- Unsloth Desktop
- Pi
How to use sylvester-francis/rust-mentor-1.7b-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf sylvester-francis/rust-mentor-1.7b-GGUF: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": "sylvester-francis/rust-mentor-1.7b-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use sylvester-francis/rust-mentor-1.7b-GGUF with Docker Model Runner:
docker model run hf.co/sylvester-francis/rust-mentor-1.7b-GGUF:Q4_K_M
- Lemonade
How to use sylvester-francis/rust-mentor-1.7b-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull sylvester-francis/rust-mentor-1.7b-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.rust-mentor-1.7b-GGUF-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use sylvester-francis/rust-mentor-1.7b-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf sylvester-francis/rust-mentor-1.7b-GGUF: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 sylvester-francis/rust-mentor-1.7b-GGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use sylvester-francis/rust-mentor-1.7b-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf sylvester-francis/rust-mentor-1.7b-GGUF: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 "sylvester-francis/rust-mentor-1.7b-GGUF: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"
RustMentor-1.7B-GGUF
RustMentor-1.7B-GGUF is a 1.7B-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-1.7b.
Model Description
- Base Model: Qwen/Qwen3-1.7B
- Model Type: Causal LM (code tutoring + review)
- Parameters: 1.7B
- Context Length: 2048 tokens
- Fine-tuning: QLoRA (r=16, alpha=16) with Unsloth optimization
- Quantization: Q4_K_M (~1.1GB)
- 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-1.7b-GGUF - Download the Q4_K_M quantization (~1.1GB)
- 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-1.7b-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-1.7b-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-1.7B |
| Method | QLoRA via Unsloth |
| LoRA Rank (r) | 16 |
| LoRA Alpha | 16 |
| Target Modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| Epochs | 3 |
| Batch Size | 2 x 4 (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-1.7B) 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
- 68
4-bit