potion-multilingual-128M (int8)
An 8-bit copy of minishlab/potion-multilingual-128M, the multilingual static embedding model by MinishLab. Same vocabulary, same tokenizer, same 256 dimensions. The embedding table is stored as int8 instead of float32, so the download of the three files the libraries load drops from 531 MB to 149 MB.
It is meant for applications that fetch the model at run time and run it on CPU.
| File | Original | This copy |
|---|---|---|
model.safetensors |
512,361,560 bytes (float32) | 130,091,948 bytes (int8, plus one float32 scale per row) |
tokenizer.json |
18,616,131 bytes | identical |
config.json |
271 bytes | identical |
Usage
Both model2vec and model2vec-rs read int8 tables natively. No conversion step is needed.
Python:
from model2vec import StaticModel
model = StaticModel.from_pretrained("soubruno/potion-multilingual-128M-int8")
embeddings = model.encode(["Hello world", "Olá, mundo"])
Rust:
use model2vec_rs::model::StaticModel;
let model = StaticModel::from_pretrained("soubruno/potion-multilingual-128M-int8", None, None, None)?;
let embeddings = model.encode(&["Hello world".to_string(), "Olá, mundo".to_string()]);
Tested with model2vec 0.10.0 and model2vec-rs 0.4.0.
How it was made
Source: revision 73908c3438cf03b6a01bcb9611d62b23d0726f08 of the original repository.
Each row of the embedding table is quantized on its own (symmetric, per row):
scale = max(|x|) / 127q = round(x / scale), clamped to [-127, 127]
The int8 rows are stored as embeddings (shape 500353 × 256). The scales are stored as weights (float32, one per token), which both libraries multiply back when they encode. This is the same arithmetic as quantize_int8 in model2vec-rs.
Fidelity
Measured with model2vec 0.10.0 on 2,477 paragraphs from 22 English Wikipedia articles and 76 search queries in Portuguese and English (72 distinct):
- Cosine similarity between the vector of this copy and the vector of the original, for the same text: minimum 0.99994 and mean 0.99998 over the paragraphs; minimum 0.99983 and mean 0.99996 over the queries.
- Retrieval over those paragraphs: same first result as the original for 97.4% of the queries; the top 10 results overlap by 98.8% on average.
This is a sanity check, not a benchmark. For MTEB results and training details, see the original model card.
Checksums (SHA-256)
e72b6c07955e754abc6823e356c55523d0c50832a665df4eff27951840150462 model.safetensors
19f1909063da3cfe3bd83a782381f040dccea475f4816de11116444a73e1b6a1 tokenizer.json
595e4cab2093732efd5dbe084fd5c1826b5eea693b73b4c1fd971672867d2e54 config.json
License and credit
MIT, the same license as the original. The model is the work of MinishLab; this repository only changes how the embedding table is stored. Please cite the original model.