Model reference · open weights
KaLM-embedding-multilingual-mini is an open-weight embedding model from HIT-TMG. AxForge deploys and operates it for you on dedicated EU-owned hardware — with the licence handled where one is required.
Available as managed deployment — configured and operated for you on dedicated EU hardware, quoted per deployment.
What it is
| Released by | HIT-TMG |
|---|---|
| Type | Embedding models |
| Task | Embeddings |
| Parameters (lead) | 494M |
| Context | 128k tokens |
| Runs with | sentence-transformers |
| Released | 2024-08-27 |
| Popularity | 6k downloads / month |
| Licence | Open weights |
About
KaLM-Embedding is a series of embedding models adapted from auto-regressive LLMs with superior training data.
KaLM-embedding-multilingual-mini is trained from Qwen/Qwen2-0.5B with massive weakly-supervised pre-training and supervised fine-tuning data.
| Model Name | Model Size | C-MTEB(35) | MTEB(56) | avg |
|---|---|---|---|---|
| multilingual-e5-large | 560M | 58.81 | 61.5 | 60.16 |
| bge-m3 (dense) | 560M | 60.80 | 59.84 | 60.32 |
| gte-multilingual-base (dense) | 305M | 62.72 | 61.40 | 62.06 |
| KaLM-embedding-multilingual-mini-v1 | 494M | 62.31 | 61.87 | 62.09 |
| KaLM-embedding-multilingual-mini-instruct-v1 | 494M | 63.57 | 64.74 | 64.16 |
| KaLM-embedding-multilingual-mini-instruct-v1.5 | 494M | 64.13 | 64.94 | 64.53 |
Since we have used the Qwen2 model, we advise you to install transformers>=4.37.0, or you might encounter the following error:
KeyError: 'qwen2'
Using this model becomes easy when you have sentence-transformers installed:
pip install -U sentence-transformers
Then you can use the model like this:
from sentence_transformers import SentenceTransformer
sentences = ["This is an example sentence", "Each sentence is converted"]
model = SentenceTransformer('{MODEL_NAME_OR_PATH}') # Do NOT set trust_remote_code
model.max_seq_length = 512
embeddings = model.encode(
sentences,
normalize_embeddings=True,
batch_size=256,
show_progress_bar=True
)
print(embeddings)
We add instruction for classification and clustering. If you want to add instruction to the query (no instruction for the corpus), you can use the model like this:
from sentence_transformers import SentenceTransformer
sentences = ["This is an example sentence", "Each sentence is converted"]
model = SentenceTransformer('{MODEL_NAME_OR_PATH}') # Do NOT set trust_remote_code
model.max_seq_length = 512
prompt = "Instruct: Classifying the category of french news. \n Query: "
embeddings = model.encode(
sentences,
prompt=prompt,
normalize_embeddings=True,
batch_size=256,
show_progress_bar=True
)
print(embeddings)
If you encounter any issue, feel free to contact us via the email: yanshek.woo@gmail.com
From the published model card. Full card on the HuggingFace links in the sidebar.
Benchmarks
As published on the model card — the maker's own numbers, not measured by AxForge.
| Task | Dataset | Metric | Score |
|---|---|---|---|
| Classification | MTEB AmazonCounterfactualClassification (en-ext) | accuracy | 74.160 |
| Classification | MTEB AmazonCounterfactualClassification (en-ext) | ap | 22.731 |
| Classification | MTEB AmazonCounterfactualClassification (en-ext) | ap_weighted | 22.731 |
| Classification | MTEB AmazonCounterfactualClassification (en-ext) | f1 | 61.311 |
| Classification | MTEB AmazonCounterfactualClassification (en-ext) | f1_weighted | 78.921 |
| Classification | MTEB AmazonCounterfactualClassification (en-ext) | main_score | 74.160 |
| Classification | MTEB AmazonCounterfactualClassification (en) | accuracy | 72.358 |
| Classification | MTEB AmazonCounterfactualClassification (en) | ap | 34.130 |
| Classification | MTEB AmazonCounterfactualClassification (en) | ap_weighted | 34.130 |
| Classification | MTEB AmazonCounterfactualClassification (en) | f1 | 65.911 |
| Classification | MTEB AmazonCounterfactualClassification (en) | f1_weighted | 74.909 |
| Classification | MTEB AmazonCounterfactualClassification (en) | main_score | 72.358 |
| Classification | MTEB AmazonPolarityClassification | accuracy | 95.269 |
| Classification | MTEB AmazonPolarityClassification | ap | 93.693 |
| Classification | MTEB AmazonPolarityClassification | ap_weighted | 93.693 |
| Classification | MTEB AmazonPolarityClassification | f1 | 95.267 |
| Classification | MTEB AmazonPolarityClassification | f1_weighted | 95.267 |
| Classification | MTEB AmazonPolarityClassification | main_score | 95.269 |
| Classification | MTEB AmazonReviewsClassification (en) | accuracy | 51.010 |
| Classification | MTEB AmazonReviewsClassification (en) | f1 | 48.699 |
| Classification | MTEB AmazonReviewsClassification (en) | f1_weighted | 48.699 |
| Classification | MTEB AmazonReviewsClassification (en) | main_score | 51.010 |
| Retrieval | MTEB ArguAna | main_score | 56.713 |
| Retrieval | MTEB ArguAna | map_at_1 | 31.437 |
Using it via the API
Once AxForge deploys kalm-embedding-multilingual-mini for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (kalm-embedding-multilingual-mini below is illustrative; you get the exact model name on deployment.)
$ curl -sS https://api.axforge.ai/v1/embeddings \
-H "Authorization: Bearer $AXFORGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"kalm-embedding-multilingual-mini","input":"text to embed"}'
Create an account — your API key is available in the console. 3M free tokens every 30 days with every new account.