Instructions to use WhiteHades/potion-retrieval-32M-int8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Model2Vec
How to use WhiteHades/potion-retrieval-32M-int8 with Model2Vec:
from model2vec import StaticModel model = StaticModel.from_pretrained("WhiteHades/potion-retrieval-32M-int8") embeddings = model.encode(["It's dangerous to go alone!", "It's a secret to everybody."]) print(embeddings.shape) - Notebooks
- Google Colab
- Kaggle
potion-retrieval-32M-int8
minishlab/potion-retrieval-32M (MIT), packed for
in-browser retrieval: every token vector stored as int8 with one float scale per token, plus the WordPiece
vocabulary, in a single 33 MB file. It is the search model of the metldr browser extension, read by the
metldr-embed Rust crate; no neural network runs, a text embeds in microseconds.
Format (potion-retrieval-32M-int8.metldr, little endian)
| field | size |
|---|---|
magic MTLDRE01 |
8 bytes |
dimension, token count, [UNK] id, vocabulary length in bytes |
4 x u32 |
vocabulary: tokens in id order, joined by \n |
vocabulary length |
| one f32 scale per token | token count x 4 |
| one int8 row per token (value x scale = original float) | token count x dimension |
Dimension 512, 63,091 tokens. A text's embedding is the normalized mean of its tokens' vectors, with
[UNK] skipped; tokens come from BERT WordPiece (lowercase, accents stripped).
Built from revision 6fc8051fab2a1e0ee76689cf08c853792ac285e7 of the base model (model.safetensors
SHA-256 07609e5bd33aad37900b3fd62f4ec96f6daec88ca4d46b9d8b928bfababf6ea0) by
pack-model model.safetensors tokenizer.json out.
Evaluation (SciFact, BEIR, 300 test queries, nDCG@10)
| setup | dense | fused with BM25 |
|---|---|---|
| base model, float32 | 0.6378 | 0.6775 |
| this file, int8 | 0.6382 | 0.6942 (weighted reciprocal rank fusion, k 5, dense weight 0.75, tuned on the train queries) |
| nomic-embed-text-v1.5 q8, 256 dimensions, for reference | 0.6260 | 0.6889 (k 60, equal weights) |
int8 storage costs no measured quality. Embedding the 5,183 SciFact documents takes about 1.2 s in WebAssembly on one thread; a dense query over them takes 0.38 ms with WebAssembly SIMD.
License
MIT, as the base model. Credit: MinishLab for Model2Vec and the potion models.
Model tree for WhiteHades/potion-retrieval-32M-int8
Base model
minishlab/potion-base-32M