Model reference · open weights

MiniCPM-Embedding-Light

Available as managed deployment Embeddings openbmb Embeddings 1 variants 12k dl/mo

MiniCPM-Embedding-Light is an open-weight embedding model from openbmb. 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

Makeropenbmb
TypeEmbedding models
TaskEmbeddings
Parameters (lead)434M
Context4k tokens
Runs withtransformers
Released2025-01-17
Popularity12k downloads / month
LicenceUnknown

About

What MiniCPM-Embedding-Light is

MiniCPM-Embedding-Light

MiniCPM-Embedding-Light 是面壁智能与清华大学自然语言处理实验室(THUNLP)、东北大学信息检索小组(NEUIR)共同开发的中英双语言文本嵌入模型,有如下特点:

  • 出色的中文、英文检索能力。
  • 出色的中英跨语言检索能力。
  • 支持长文本(最长8192token)。
  • 提供稠密向量与token级别的稀疏向量。
  • 可变的稠密向量维度(套娃表征)。

MiniCPM-Embedding-Light结构上采取双向注意力和 Weighted Mean Pooling [1]。采取多阶段训练方式,共使用包括开源数据、机造数据、闭源数据在内的约 260M 条训练数据。

欢迎关注 UltraRAG 系列:

MiniCPM-Embedding-Light is a bilingual & cross-lingual text embedding model developed by ModelBest Inc. , THUNLP and NEUIR , featuring:

  • Exceptional Chinese and English retrieval capabilities.
  • Outstanding cross-lingual retrieval capabilities between Chinese and English.
  • Long-text support (up to 8192 tokens).
  • Dense vectors and token-level sparse vectors.
  • Variable dense vector dimensions (Matryoshka representation [2]).

MiniCPM-Embedding-Light incorporates bidirectional attention and Weighted Mean Pooling [1] in its architecture. The model underwent multi-stage training using approximately 260 million training examples, including open-source, synthetic, and proprietary data.

We also invite you to explore the UltraRAG series:

[1] Muennighoff, N. (2022). Sgpt: Gpt sentence embeddings for semantic search. arXiv preprint arXiv:2202.08904. [2] Kusupati, Aditya, et al. "Matryoshka representation learning." Advances in Neural Information Processing Systems 35 (2022): 30233-30249.

模型信息 Model Information

  • 模型大小:440M

  • 嵌入维度:1024

  • 最大输入token数:8192

  • Model Size: 440M

  • Embedding Dimension: 1024

  • Max Input Tokens: 8192

使用方法 Usage

输入格式 Input Format

本模型支持 query 侧指令,格式如下:

MiniCPM-Embedding-Light supports query-side instructions in the following format:

Instruction: {{ instruction }} Query: {{ query }}

例如:

For example:

Instruction: 为这个医学问题检索相关回答。Query: 咽喉癌的成因是什么?
Instruction: Given a claim about climate change, retrieve documents that support or refute the claim. Query: However the warming trend is slower than most climate models have forecast.

也可以不提供指令,即采取如下格式:

MiniCPM-Embedding-Light also works in instruction-free mode in the following format:

Query: {{ query }}

环境要求 Requirements

transformers==4.37.2

示例脚本 Demo

Huggingface Transformers

from transformers import AutoModel
import torch

model_name = "openbmb/MiniCPM-Embedding-Light"
model = AutoModel.from_pretrained(model_name, trust_remote_code=True, torch_dtype=torch.float16).to("cuda")

# you can use flash_attention_2 for faster inference
# model = AutoModel.from_pretrained(model_name, trust_remote_code=True, attn_implementation="flash_attention_2", torch_dtype=torch.float16).to("cuda")

model.eval()

queries = ["MiniCPM-o 2.6 A GPT-4o Level MLLM for Vision, Speech and Multimodal Live Streaming on Your Phone"]
passages = ["MiniCPM-o 2.6 is the latest and most capable model in the MiniCPM-o series. The model is built in an end-to-end fashion based on SigLip-400M, Whisper-medium-300M, ChatTTS-200M, and Qwen2.5-7B with a total of 8B parameters. It exhibits a significant performance improvement over MiniCPM-V 2.6, and introduces new features for real-time speech conversation and multimodal live streaming."]

embeddings_query_dense, embeddings_query_sparse = model.encode_query(queries, return_sparse_vectors=True)
embeddings_doc_dense, embeddings_doc_sparse = model.encode_corpus(passages, return_sparse_vectors=True)

dense_scores = (embeddings_query_dense @ embeddings_doc_dense.T)
print(dense_scores.tolist())  # [[0.6512398719787598]]
print(model.compute_sparse_score_dicts(embeddings_query_sparse,  embeddings_doc_sparse)) # [[0.27202296]]

dense_scores, sparse_scores, mixed_scores = model.compute_score(queries, passages)
print(dense_scores) # [[0.65123993]]
print(sparse_scores) # [[0.27202296]]
print(mixed_scores) # [[0.73284686]]

Sentence Transformers

import torch
from sentence_transformers import SentenceTransformer

model_name = "openbmb/MiniCPM-Embedding-Light"
model = SentenceTransformer(model_name, trust_remote_code=True, model_kwargs={"torch_dtype": torch.float16})

# you can use flash_attention_2 for faster inference
# model = SentenceTransformer(model_name, trust_remote_code=True, model_kwargs={"attn_implementation": "flash_attention_2", "torch_dtype": torch.float16})

queries = ["中国的首都是哪里?"] # "What is the capital of China?"
passages = ["beijing", "shanghai"] # "北京", "上海"

INSTRUCTION = "Query: "

embeddings_query = model.encode(queries, prompt=INSTRUCTION)
embeddings_doc = model.encode(passages)

scores = (embeddings_query @ embeddings_doc.T)
print(scores.tolist())  # [[0.40356746315956116, 0.36183440685272217]]

Infinity

import asyncio
from infinity_emb import AsyncEngineArray, EngineArgs, AsyncEmbeddingEngine
import numpy as np

array = AsyncEngineArray.from_args([
  EngineArgs(model_name_or_path = "openbmb/MiniCPM-Embedding-Light", engine="torch", dtype="float16", bettertransformer=False, pooling_method="mean", trust_remote_code=True),
])
queries = ["中国的首都是哪里?"] # "What is the capital of China?"
passages = ["beijing", "shanghai"] # "北京", "上海"

INSTRUCTION = "Query:"
queries = [f"{INSTRUCTION} {query}" for query in queries]

async def embed_text(engine: AsyncEmbeddingEngine,sentences):
    async with engine:
        embeddings, usage = await engine.embed(sentences=sentences)
    return embeddings

queries_embedding = asyncio.run(embed_text(array[0],queries))
passages_embedding = asyncio.run(embed_text(array[0],passages))

scores = (np.array(querie

From the published model card. Full card on the HuggingFace links in the sidebar.

Benchmarks

Reported results

As published on the model card — the maker's own numbers, not measured by AxForge.

TaskDatasetMetricScore
STSMTEB AFQMC (default)cosine_pearson31.602
STSMTEB AFQMC (default)cosine_spearman32.266
STSMTEB AFQMC (default)euclidean_pearson31.387
STSMTEB AFQMC (default)euclidean_spearman32.266
STSMTEB AFQMC (default)main_score32.266
STSMTEB AFQMC (default)manhattan_pearson31.012
STSMTEB AFQMC (default)manhattan_spearman31.881
STSMTEB AFQMC (default)pearson31.602
STSMTEB AFQMC (default)spearman32.266
STSMTEB ATEC (default)cosine_pearson40.900
STSMTEB ATEC (default)cosine_spearman40.342
STSMTEB ATEC (default)euclidean_pearson43.266
STSMTEB ATEC (default)euclidean_spearman40.342
STSMTEB ATEC (default)main_score40.342
STSMTEB ATEC (default)manhattan_pearson43.094
STSMTEB ATEC (default)manhattan_spearman40.133
STSMTEB ATEC (default)pearson40.900
STSMTEB ATEC (default)spearman40.342
STSMTEB ATEC (default)cosine_pearson40.977
STSMTEB ATEC (default)cosine_spearman41.151
STSMTEB ATEC (default)euclidean_pearson43.127
STSMTEB ATEC (default)euclidean_spearman41.151
STSMTEB ATEC (default)main_score41.151
STSMTEB ATEC (default)manhattan_pearson43.016

Using it via the API

Call it like any OpenAI endpoint

Once AxForge deploys minicpm-embedding-light for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (minicpm-embedding-light 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":"minicpm-embedding-light","input":"text to embed"}'

Create an account — your API key is available in the console. 5M tokens/month currently included with every new account at launch.

© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms