Build with MiniCPM5-1B: A Minimal LLM Inference Engine Written in Rust🦀
Developer @XinyuBaoXYB created tiny-llm, a pure Rust inference engine for MiniCPM5-1B, built to explore the fundamentals of Transformer and LLM inference.
Instead of hiding the complexity behind high-level frameworks, tiny-llm makes the inference process visible and understandable: ⚡ CPU-only inference - no GPU required 🧩 Pure Rust implementation with a single-file core 🔍 No KV cache - keeping the inference pipeline simple and transparent 📊 TUI visualization for attention maps, tensor shapes, logits, and execution timing
The project implements essential Transformer components: 🔹 Token Embedding 🔹 RoPE positional encoding 🔹 Multi-head Attention with GQA 🔹 SwiGLU MLP 🔹 RMSNorm 🔹 Residual connections 🔹 Autoregressive token generation
tiny-llm works like an "LLM anatomy lab", allowing developers to trace how input text is transformed into tokens, processed through transformer layers, and turned into generated output.
A great example of open-source developers making LLM internals more accessible through hands-on implementation. 🚀
Explore the project: 🔗 https://github.com/AspadaX/tiny-llm
Model: 🤗 Hugging Face: https://huggingface.co/openbmb/MiniCPM5-1B