AI / LLMOps2025

RustSensei

Local AI assistant to learn Rust in French, with LoRA fine-tuning and RAG over the official documentation.

LLMLoRARAGllama.cppQwenPythonRustFine-tuning

Concept & Approach

RustSensei is a teaching-oriented AI assistant designed to teach the Rust language in French. The goal: make learning Rust accessible with a 100% local and free tool. Why this project: - Rust is known to be hard to learn (ownership, borrowing, lifetimes) - Few learning resources in French - General-purpose LLMs lack precision on advanced Rust concepts - Need for a tool that works offline for confidentiality Local-First approach: - No dependency on an external API - Works fully offline once installed - Optimized for Apple Silicon (Metal/MPS) - User data never transmitted Current version: v1.0 as a CLI A React + TypeScript + Tailwind web interface is under development for v2.
v1.0 CLI
Version
French
Language
100% Local
Mode
Beginners
Target
RustSensei CLI - Error analysis
CLI v1: compilation error analysis with RAG sources (Rust Book)

Technical Architecture

Tech stack optimized for fast local inference with custom fine-tuning. Base model: - Qwen2.5-Coder-1.5B-Instruct as the foundation - Compact model (1.5B parameters) for fast inference - Specialized in code generation LoRA fine-tuning: - Rank 8 for a good quality/size trade-off - Dataset of 49 Rust examples in French - Focus on fundamental concepts (structs, enums, ownership, borrowing) - Lightweight adapter (~10MB) instead of retraining the whole model Inference: - llama.cpp for optimized execution - Metal/MPS support for Apple Silicon GPUs - GGUF format for quantized models - Lower latency thanks to GPU acceleration RAG (Retrieval-Augmented Generation): - Indexing of the official Rust documentation - Answers enriched with reliable sources - +10% improvement on the benchmarks
Qwen2.5-1.5B
Base
LoRA r8
Fine-tuning
llama.cpp
Inference
+10%
RAG boost
RustSensei architecture
Pipeline: question → system prompt → optional RAG → llama.cpp → structured answer

Evaluation & Metrics

Rigorous evaluation protocol on 20 test prompts covering the key Rust concepts. Overall metrics: - Overall score: 3.07/5 - French accuracy: 95% - Valid code blocks: 70% - Compilation rate: 87% Performance by category: - Enums: 4.24/5 (best) - Structs: 4.02/5 - Borrowing: 3.39/5 - Basics: 3.02/5 - Ownership: 2.54/5 - Lifetimes: 1.25/5 (to improve) RAG impact: - Without RAG: 3.05/5 - With RAG: 3.35/5 - Gain: +10% performance Identified limitations: - Advanced concepts (lifetimes, unsafe, async) less well handled - Training dataset geared toward beginner/intermediate level - Macros and complex patterns out of current scope
3.07/5
Score
87%
Compilation rate
95%
French accuracy
Enums 4.24
Best
RustSensei - Ownership explanation
1 / 2
RAG in action: explanation of ownership with sources from the Rust Book

Roadmap v2.0

Version 2.0 is under development with a major redesign of the user experience. Web interface (in progress): - Frontend: React + TypeScript + Tailwind CSS - Backend: FastAPI for the REST API - Modern UI with a dark theme - Persistent conversation history Planned improvements: - Extended dataset with more advanced examples - Reranking to improve RAG relevance - Docker support for simplified deployment - Human evaluation to refine the metrics v2 quality goals: - Overall score > 3.5/5 - Better lifetimes handling (goal > 2.5/5) - Coverage of async/await concepts - Complete user documentation
React + TS
Frontend
FastAPI
Backend
> 3.5/5
Goal
Docker
Deploy
  _____  _____ _____
 |  __ \|  __ \_   _|
 | |__) | |__) || |
 |  _  /|  ___/ | |
 | | \ \| |    _| |_
 |_|  \_\_|   |_____|

Self-hosted on Raspberry Pi 5

~/links

$ echo "Made with passion"

© 2026 Abdel Touati