API reference
Reference for the model-agnostic core and the Gemma 3 architecture that builds on it.
The framework separates model-agnostic machinery from per-model wiring. Everything under core/ and kernels/ works on any decoder with the standard projection layout; each supported model adds a thin adapter under models/.
Decomposition
Use core.decompose to turn a HuggingFace checkpoint into a theta bundle.
WeightlessLinear
The drop-in linear layer and its stacked variant.
Gemma 3 architecture
How Gemma 3 registers as a weightless custom architecture.
Gemma 4 quality
Decomposition quality and activation fix for Gemma 4 31B on B200.
Package layout
weightless_fw/
├─ core/ # model-agnostic decomposition, layers, GEMM formulation
│ ├─ decompose.py
│ ├─ weightless_linear.py
│ ├─ weightless_mlp.py
│ └─ gemm_formulation.py
├─ kernels/ # generated_linear Mojo custom op (CPU + Metal + NVIDIA B200)
│ └─ generated_linear.mojo
├─ models/
│ ├─ gemma3/ # config, arch registration, adapters, model wrapper
│ └─ gemma4/ # Gemma 4 31B: dual head dims, sliding window, MoE-aware
└─ run_max.py # MAX CLI wrapper
The package’s top-level ARCHITECTURES list is what MAX reads when you pass --custom-architectures weightless_fw.