How rustingstudio/rustingstrata works
RustingStrata is a pure-Rust GGUF inference engine and local chat/API server, designed to run MoE models whose weights exceed GPU memory. The main workflow is selecting or downloading a model, parsing its GGUF metadata and weights, running prompt prefill and token-by-token inference, then decoding and streaming a response. GPU execution is abstracted across CUDA, Vulkan, and experimental HIP; CPU workers handle routed experts that miss GPU residency. The graph also preserves documented model-family, vision, calibration, and MCP capabilities. Unsampled subsystem links are omitted where their callers are not evidenced.
Main entry points: gpu_model.rs GPU model runtime · backend.rs Backend interface · weights.rs Tensor weights · serve.rs HTTP server
Components 34
User interfaces
- CLI entry
src/main.rs - Chat workflow
src/chat.rs - HTTP server
src/serve.rs - Terminal chat
src/term.rs
Model and weights
- Tokenization
src/tokenizer.rs - GGUF reader
src/gguf.rs - Model configuration
src/config.rs - Tensor weights
src/weights.rs - Quantization
src/quant/mod.rs
Inference runtime
- CPU reference model
src/model.rs - GPU model runtime
src/gpu_model.rs - Prompt prefill
src/gpu_model/prefill.rs - CPU expert worker
src/cpu_worker.rs - CPU MoE kernels
src/cpu_moe.rs - Expert cache
src/expert_cache.rs - Sampling and grammar
src/grammar.rs - DeepSeek family
src/deepseek/forward.rs - Gemma 4 family
src/gemma4/forward.rs - GLM family
src/glm/forward.rs - Hy4 family
src/hy4/forward.rs - Inkling 2 family
src/inkling2/forward.rs - Kolibri family
src/kolibri/forward.rs - Raon family
src/raon/forward.rs - GigaChat 4 family
src/gigachat4/forward.rs - Runtime memory
src/memory.rs - Inference operations
src/ops.rs
Execution backends
- Backend interface
src/backend.rs - CUDA backend
src/cuda/mod.rs - Vulkan backend
src/vulkan/mod.rs - HIP backend
src/hip/mod.rs
Product capabilities
- Vision input
src/vision/projector.rs - MCP tools
src/mcp.rs - Calibration
src/calibrate.rs
Other components
- User or API client
Connections 39
- User or API client → CLI entry: starts
README.md - CLI entry → HTTP server: starts server
README.md - CLI entry → Terminal chat: starts chat
README.md - HTTP server → Chat workflow: routes chat
src/serve.rs - HTTP server → Tokenization: uses
src/serve.rs - HTTP server → Sampling and grammar: uses
src/serve.rs - Chat workflow → HTTP server: uses
src/chat.rs - CLI entry → GGUF reader: loads model
- GGUF reader → Quantization: validates types
src/gguf.rs - Tensor weights → GGUF reader: reads tensors
src/weights.rs - Tensor weights → Model configuration: uses
src/weights.rs - Tensor weights → Quantization: dequantizes
src/weights.rs - CPU reference model → Model configuration: uses
src/model.rs - CPU reference model → Tensor weights: reads weights
src/model.rs - CPU reference model → Inference operations: uses math
src/model.rs - GPU model runtime → Backend interface: dispatches ops
src/gpu_model.rs - GPU model runtime → Model configuration: uses
src/gpu_model.rs - GPU model runtime → Tensor weights: uploads weights
src/gpu_model.rs - GPU model runtime → Prompt prefill: uses prefill
src/gpu_model.rs - GPU model runtime → CPU expert worker: coordinates experts
src/gpu_model.rs - GPU model runtime → Expert cache: manages cache
src/gpu_model.rs - CPU expert worker → CPU MoE kernels: computes misses
src/cpu_worker.rs - CPU expert worker → Backend interface: uses buffers
src/cpu_worker.rs - Backend interface → Tensor weights: uploads tensors
src/backend.rs - Backend interface → CUDA backend: implemented by
src/backend.rs - Backend interface → Vulkan backend: implemented by
src/backend.rs - Backend interface → HIP backend: implemented by
src/backend.rs - Backend interface → Quantization: uses types
src/backend.rs - GPU model runtime → DeepSeek family: supports family
- GPU model runtime → Gemma 4 family: supports family
- GPU model runtime → GLM family: supports family
- GPU model runtime → Hy4 family: supports family
- GPU model runtime → Inkling 2 family: supports family
- GPU model runtime → Kolibri family: supports family
- GPU model runtime → Raon family: supports family
- GPU model runtime → GigaChat 4 family: supports family
- User or API client → Vision input: provides images
- User or API client → MCP tools: invokes tools
- User or API client → Calibration: runs calibration
README.md