Repository navigation
v0.4.0
Oumi Weights Lab 0.4 loads models quantized to 4 or 8 bits with bitsandbytes, so a 7–30B model fits on one consumer GPU or a Mac, and you can still edit its packed weights and undo exactly. Version 0.4 is experimental, and snippets run as trusted Python with your filesystem and network access.
Tested on CPU with tiny GPT-2 and grouped-query Llama models, on the oldest and newest supported versions of PyTorch, Transformers, PEFT, and bitsandbytes. The live check loaded, edited, saved, resumed, and exported Qwen2.5-7B-Instruct in nf4 and int8 on one NVIDIA L40S, and Qwen2.5-0.5B-Instruct on an Apple-silicon Mac.
Highlights
Loading
start --quantize nf4,fp4, orint8loads a model with bitsandbytes on CUDA, Apple MPS (macOS 14 and torch 2.5 or later), or CPU. Embeddings, norms, biases, andlm_headstay in float.- Scoring, generation,
record,patch,heads,head_weights, and activation gradients work on the quantized model.partsandmeasurereport the logical shape plus the packed layout. - Checkpoints already quantized with bitsandbytes load as they are. LoRA adapters load on a quantized base.
- Kernel code from the Hugging Face Hub is blocked unless you pass
--allow-hub-kernels.
Editing
edit,zero,swap, andproject_outwork on nf4, fp4, and int8 weights. Each edit requantizes only the blocks it touches: 64 weights for 4-bit, one row for int8.undorestores the packed bytes and scales exactly, so logits return bit for bit.- Each edit records the change you asked for, the change that landed, and how far the untouched values in its blocks moved. An edit too small to survive rounding warns instead of passing silently.
Saving and export
save_editsand--resumekeep quantized edits byte for byte, and resume checks the method, block size, and starting bytes before changing anything.exportwrites the quantized checkpoint, which reloads with plainfrom_pretrainedto the same bytes and logits. Merging a LoRA adapter into a quantized base is refused.
A new recipe covers quantized models, and another walks through finding and testing a circuit with the tools from 0.3.
Install this version
Claude Code:
claude plugin marketplace add oumi-ai/weights-lab
claude plugin install oumi-weights-lab@oumi-weights-labThe plugin includes quantized loading, except on Intel Macs and macOS before 14, where bitsandbytes has no wheel.
CLI, pinned to this release, with LoRA adapters, Hugging Face datasets, multi-GPU loading, and quantized loading:
uv tool install 'oumi-weights-lab[adapters,datasets,multi-gpu,quantized] @ git+https://github.com/oumi-ai/weights-lab@v0.4.0'See the README for Codex and other agents.
What's Changed
- Load models quantized with bitsandbytes, read-only by @jgreer013 in #51
- Edit nf4 and fp4 weights in place with exact byte-level undo by @jgreer013 in #52
- Edit int8 weights row by row with exact undo by @jgreer013 in #53
- Save, resume and export quantized edits by @jgreer013 in #54
- Add a recipe for finding and testing a circuit by @jgreer013 in #55
- Set the version to 0.4.0 by @jgreer013 in #56
Full Changelog: v0.3.0...v0.4.0