Fortytwo-Network/Strandset-Rust-v1
Viewer • Updated • 191k • 355 • 42
RustMentor-0.6B is a 0.6B-parameter Qwen3-based model fine-tuned for Rust programming education and code review. It bridges concepts from Go, Python, and TypeScript to teach Rust through practical examples and Socratic dialogue.
This repository hosts the LoRA adapter weights. For quantized local inference, see rust-mentor-0.6b-GGUF.
Primary: Rust programming tutoring, debugging, code review, and guided learning for developers transitioning from Go/Python/TypeScript.
Out-of-scope: General-purpose chat, non-Rust programming, safety-sensitive or factual tasks outside Rust development.
"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."
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model = AutoModelForCausalLM.from_pretrained(
"sylvester-francis/rust-mentor-0.6b",
torch_dtype=torch.float16,
device_map="auto",
)
tokenizer = AutoTokenizer.from_pretrained("sylvester-francis/rust-mentor-0.6b")
messages = [
{"role": "system", "content": "You are RustMentor, an expert Rust programming tutor."},
{"role": "user", "content": "Explain Rust's ownership model to someone who knows Go."},
]
input_text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(input_text, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=512,
temperature=0.7,
top_p=0.9,
do_sample=True,
pad_token_id=tokenizer.eos_token_id,
)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
| 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) |
Qualitative checks on Rust tutoring prompts show:
Apache 2.0 for the fine-tuned adapter; base model (Qwen/Qwen3-0.6B) license also applies.