Downloads · 30 days
24
16% of all-time downloads
Nichonauta/LFM2.5-350M-ToMoE-INT4
LFM2.5-350M-ToMoE-INT4 is a text generation model from Nichonauta. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as other.
Weight-only INT4 quantization of the real ToMoE MoE — Nichonauta/LFM2.5-350M-ToMoE (derived from LiquidAI/LFM2.5-350M).
Downloads · 30 days
24
16% of all-time downloads
All-time downloads
146
Public
Parameters
203M
420 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors420 MB · 99%
How the weights are stored.
U8131M · 65%
From the Hugging Face model README
Weight-only INT4 quantization of the real ToMoE MoE — Nichonauta/LFM2.5-350M-ToMoE (derived from LiquidAI/LFM2.5-350M).
Unlike the GGUF companions (which are dense-equivalents because llama.cpp cannot represent the channel-MoE), this repository stores the actual pruned MoE weights quantized in safetensors format:
LinearINT4 replaces the MLP/attention/conv Linear layers (per-channel symmetric for INT8; per-group of 64 with zero-point for INT4), packed 2-nibbles-per-byte for INT4.modeling_lfm2_moe_final.py, trust_remote_code), plus the quantization flag in config.json.| Metric | fp32 MoE | INT8 | INT4 |
|---|---|---|---|
| PPL wikitext-2 (raw, 1810 tok) | 994 | 987 | 1221 |
| PPL chat-formatted (prompt+answer) | 314 | 785 | 941 |
model.safetensors size | 1226 MB | 400 MB | — |
The 350M MoE sits at a fragile equilibrium (chat PPL 314 is already near the repetition-collapse regime): INT8 pushes it to ~785 and INT4 to ~941 on chat, while raw-text PPL stays roughly unchanged. This is a property of the pruned model, not of the quantizer.
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"Nichonauta/LFM2.5-350M-ToMoE-INT4",
trust_remote_code=True,
torch_dtype=torch.bfloat16,
device_map="cuda:0",
attn_implementation="eager",
)
tokenizer = AutoTokenizer.from_pretrained("Nichonauta/LFM2.5-350M-ToMoE-INT4")
The quantization field in config.json makes the custom modeling file build the quantized Linear layers automatically.
model.safetensors — INT4 weights + fp32 scales/zero-points + fp32 routers/embeddings/buffersmodeling_lfm2_moe_final.py — custom model definition with LinearINT4 support (trust_remote_code)config.json — model configuration (quantization: "int4", auto_map)tokenizer.json, tokenizer_config.json, chat_template.jinja, generation_config.json, LICENSEDerivative of LiquidAI/LFM2.5-350M — released under the LFM Open License v1.0 (see LICENSE).