Pure Rust multimodal inference engine based on Qwen3.5-0.8B. No Python, no CUDA, no external ML frameworks. Single executable + model weights = portable AI that runs on any machine.
Designed for mobile and edge devices — only 600 MB model file, loads in under 1 second, and runs at ~4 tok/s on a standard CPU. Smart system awareness — automatically detects your hardware (RAM, CPU threads) on Windows, Linux, and macOS, and adjusts generation parameters so the model runs well even on constrained systems.
License
This project is licensed under Apache 2.0. The base model Qwen3.5-0.8B is released by the Qwen team under Apache 2.0.
What It Does
QORA-0.8B is a 0.8-billion parameter language model with built-in vision. It can:
Text generation — answer questions, write code, summarize text
Image understanding — describe photos, answer questions about images
Video understanding — analyze frame sequences, describe motion and temporal changes
Thinking mode — chain-of-thought reasoning with configurable budget
Architecture
QORA-0.8B uses a hybrid architecture combining two attention mechanisms:
Component
Details
Parameters
0.8B total
Hidden dim
1024
Layers
24 (18 DeltaNet + 6 Full Attention)
Layer pattern
3x DeltaNet + 1x Full Attention, repeated 6 times
Vocabulary
248,320 tokens
Context
262K tokens natively
DeltaNet Layers (18 of 24)
Gated linear attention with delta rule state updates
16 QK heads + 16 V heads, head_dim=128
Causal Conv1d (kernel=4) + SiLU activation
O(1) memory per token (recurrent state, no KV cache needed)
Hard caps apply even to explicit user values — if you pass --max-tokens 5000 on a system with 6 GB free RAM, it gets clamped to 1024 automatically. This prevents the model from running for too long on weak systems.
Supports Windows (wmic), Linux (/proc/meminfo), and macOS (sysctl/vm_stat).
Weight Format
Format
Size
Quality
Speed
Q4 (default)
~600 MB
Good
~3.9 tok/s
Q4 uses 4-bit symmetric quantization with group_size=32 and LUT-optimized dequantization. Multi-threaded GEMV/GEMM via rayon for large matrices.
AVX-512 SIMD Acceleration
On CPUs with AVX-512 support (Intel 11th gen+, AMD Zen 4+), QORA-0.8B automatically uses hand-written AVX-512 SIMD kernels for significant CPU speedup:
Kernel
Technique
Speedup
Q4 GEMV
permutexvar_ps 16-entry LUT lookup, nibble extract via cvtepu8_epi32
~2.5x
F16 GEMV
cvtph_ps f16→f32 + fmadd_ps FMA accumulation
~2.5x
DeltaNet state
Vectorized decay/retrieve/delta/output over 128-dim heads
~3x
Fused gate+up
Parallel gate & up SIMD LUT decode in MLP
~2.5x
Detection is automatic at runtime — falls back to scalar code on non-AVX-512 CPUs with zero overhead.
The model is small enough that Q4 is the only format needed — it loads in under 1 second and uses minimal RAM.
Platform Support
Platform
Binary
Status
Windows x86_64
qor08b.exe
Tested
Linux x86_64
qor08b
Supported
macOS aarch64
qor08b
Supported
CPU-only by design — the 0.8B model is small and fast enough that GPU is not needed. Pre-built binaries are available on the Releases page.
qor08b.exe (Windows) or build from source (Linux/macOS)
Run:
bash
1# Text generation2qor08b --prompt "Explain quantum computing" --max-tokens 50034# Image understanding5qor08b --prompt "What's in this image?" --image photo.jpg
67# Video understanding (directory of frame images)8qor08b --prompt "What happens in this video?" --video frames_dir/
910# Thinking mode (default, extended reasoning)11qor08b --prompt "What is the capital of France?" --think-budget 5121213# No-think mode (faster, direct answers)14qor08b --prompt "What is 2+2?" --no-think
1516# Greedy decoding (deterministic output)17qor08b --prompt "Hello" --greedy
CLI Flags
Flag
Description
--prompt TEXT
Input prompt (default: "Hello, how are you?")
--image PATH
Path to an image file (PNG/JPG)
--video PATH
Path to directory of frame images (PNG/JPG, sorted by name)
--max-tokens N
Max tokens to generate (default: 1024)
--think-budget N
Max thinking tokens before forcing answer (default: 1024)
--no-think
Disable thinking mode (direct answers)
--show-think
Display thinking tokens on stderr
--greedy
Greedy decoding (temperature=0, not recommended with thinking mode)
Sampling Defaults
Parameter
Think mode
No-think mode
temperature
1.0
0.7
top_k
20
20
top_p
0.95
0.95
presence_penalty
1.5
1.5
Video Input
Video is provided as a directory of frame images (not a video file). Extract frames however you like:
bash
1# Example: extract 4 frames from a video with ffmpeg2ffmpeg -i video.mp4 -vf "select=not(mod(n\,30))" -frames:v 4 frames/frame_%02d.png
34# Then run5qor08b --prompt "Describe what happens" --video frames/
Frames are loaded in alphabetical order, resized to uniform dimensions (max 768px, divisible by 32), and processed as temporal pairs via Conv3d. Odd frame counts are padded by duplicating the last frame.
Building from Source
bash
1# All platforms (CPU-only, no GPU needed)2cargo build --release
Dependencies
Language: Pure Rust (2024 edition)
cortex — Rust deep learning framework (used for binary format types only)
rayon — Thread pool for parallel GEMV, attention
half — F16 support
image — Image loading (PNG/JPG)
tokenizers — HuggingFace tokenizer
memmap2 — Memory-mapped I/O for converter
serde_json — Config parsing
No ML framework for inference — all matrix ops are hand-written Rust
Cross-Platform Releases
Pre-built binaries are automatically built via GitHub Actions for:
Windows x86_64
Linux x86_64
macOS aarch64
Create a git tag (e.g. v0.1.0) and push to trigger a release build.
Header: "QR08" magic + version(u32) + format(u8: 0=F16, 1=Q4)
Config: Architecture params (vocab, hidden, layers, heads, etc.)
Layers: 24 layers, each with type byte + layer-specific weights
Global: Embedding + final norm + precomputed RoPE tables
Vision: Conv3d patch embed + pos_embed + 12 ViT blocks + merger MLP
Loading is ~500ms for the Q4 model (~600 MB) via buffered sequential reads.
Performance
Tested on i5-11500 (6C/12T), 16GB RAM:
Task
Speed
Text decode
~3.9 tok/s
Text prefill
~13 tok/s (batched DeltaNet)
Model load
~500ms (Q4, 600 MB)
RAM usage
~791 MB
CPU-only by design — the 0.8B model is small enough that CPU inference is fast and efficient, making it ideal for mobile and edge deployment without GPU dependencies. Batched DeltaNet prefill processes all GEMM projections in parallel across tokens, with only the lightweight conv1d and recurrent state update running sequentially.