potion-multilingual-128M · int8
An int8 version of minishlab/potion-multilingual-128M, the 101-language static embedding model by The Minish Lab. Same vectors, a quarter of the size.
| original (f32) | this (int8) | |
|---|---|---|
model.safetensors |
512.4 MB | 130.1 MB |
| RAM once loaded (embedding table) | ~512 MB | ~128 MB |
| cosine to the original vector | 1 | ≥ 0.99996 |
It is a drop-in replacement: same tokenizer, same config, standard model2vec format. Nothing to change in your code but the model id.
Usage
Python (model2vec):
from model2vec import StaticModel
model = StaticModel.from_pretrained("natzx94/potion-multilingual-128M-int8")
vectors = model.encode(["fallo de login en la pantalla de acceso", "login failure on the sign-in screen"])
Rust (model2vec-rs):
use model2vec_rs::model::StaticModel;
let model = StaticModel::from_pretrained("natzx94/potion-multilingual-128M-int8", None, None, None)?;
let vectors = model.encode(&["fallo de login en la pantalla de acceso".to_string()]);
How it was made
The model is a table of 500,353 token vectors × 256 dimensions. Each row is quantized on its own:
scale = max(|row|) / 127row_int8 = round(row / scale), clamped to [-127, 127]
The per-row scale is stored in the standard weights tensor (one float per token, which model2vec already multiplies into each row when pooling). That is why both libraries load it unchanged, with no custom code: the embeddings tensor is I8 and weights carries the scales. The original model has no weights or mapping tensors, so there was nothing else to fold in.
Verification
- model2vec-rs 0.3.0: minimum cosine 0.99996 against the f32 original on Spanish, English and mixed sentences.
- model2vec 0.10.0 (Python): cosine 0.99997–0.99998 against the f32 original, including Japanese.
- Mean pooling averages many rows, and rounding errors point in random directions, so they cancel out: rankings in search are the same.
Why
Static models are often loaded once per process. With several processes open at once (one per editor or agent session), 512 MB each adds up fast. This version was made for Omoikane, a local memory for AI coding agents, where every session runs its own process. Omoikane also loads it in about 3 ms instead of ~2 s by precompiling the tokenizer's vocabulary (see model2vec-rs#68).
License and credit
MIT, like the original. All the modelling work is The Minish Lab's: see the original model card for training data, evaluation (MTEB) and supported languages. Quantized by Marc Mayol.