Model reference · open weights

Dmeta-embedding-zh

Available as managed deployment Embeddings DMetaSoul Embeddings 1 variants 910 dl/mo

Dmeta-embedding-zh is an open-weight embedding model from DMetaSoul. 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 byDMetaSoul
TypeEmbedding models
TaskEmbeddings
Context1k tokens
Runs withsentence-transformers
Released2024-01-25
Popularity910 downloads / month
LicenceOpen weights

About

What Dmeta-embedding-zh is

Update News

  • 2024.04.01, The Dmeta-embedding small version is released. Just with 8 layers, inference is more efficient, about 30% improved.

  • 2024.02.07, The Embedding API service based on the Dmeta-embedding model now open for internal beta testing. Click the link to apply, and you will receive 400M tokens for free, which can encode approximately GB-level Chinese text.

Read the full model card
  • Our original intention. Let everyone use Embedding technology at low cost, pay more attention to their own business and product services, and leave the complex technical parts to us.
  • How to apply and use. Click the link to submit a form. We will reply to you via within 48 hours. In order to be compatible with the large language model (LLM) technology ecosystem, our Embedding API is used in the same way as OpenAI. We will explain the specific usage in the reply email.
  • Join the ours. In the future, we will continue to work in the direction of large language models/AIGC to bring valuable technologies to the community. You can click on the picture and scan the QR code to join our WeChat community and cheer for the AIGC together!

Dmeta-embedding is a cross-domain, cross-task, out-of-the-box Chinese embedding model. It is suitable for various scenarios such as search engine, Q&A, intelligent customer service, LLM+RAG, etc. It supports inference using tools like Transformers/Sentence-Transformers/Langchain.

Features:

  • Excellent cross-domain and scene generalization performance, currently ranked second on the MTEB Chinese leaderboard. (2024.01.25)
  • The parameter size of model is just 400MB, which can greatly reduce the cost of inference.
  • The context window length is up to 1024, more suitable for long text retrieval, RAG and other scenarios

Usage

The model supports inference through frameworks such as Sentence-Transformers, Langchain, Huggingface Transformers, etc. For specific usage, please refer to the following examples.

Sentence-Transformers

Load and inference Dmeta-embedding via sentence-transformers as following:

pip install -U sentence-transformers
from sentence_transformers import SentenceTransformer

texts1 = ["胡子长得太快怎么办?", "在香港哪里买手表好"]
texts2 = ["胡子长得快怎么办?", "怎样使胡子不浓密!", "香港买手表哪里好", "在杭州手机到哪里买"]

model = SentenceTransformer('DMetaSoul/Dmeta-embedding')
embs1 = model.encode(texts1, normalize_embeddings=True)
embs2 = model.encode(texts2, normalize_embeddings=True)

similarity = embs1 @ embs2.T
print(similarity)

for i in range(len(texts1)):
    scores = []
    for j in range(len(texts2)):
        scores.append([texts2[j], similarity[i][j]])
    scores = sorted(scores, key=lambda x:x[1], reverse=True)

    print(f"查询文本:{texts1[i]}")
    for text2, score in scores:
        print(f"相似文本:{text2},打分:{score}")
    print()

Output:

查询文本:胡子长得太快怎么办?
相似文本:胡子长得快怎么办?,打分:0.9535336494445801
相似文本:怎样使胡子不浓密!,打分:0.6776421070098877
相似文本:香港买手表哪里好,打分:0.2297907918691635
相似文本:在杭州手机到哪里买,打分:0.11386542022228241

查询文本:在香港哪里买手表好
相似文本:香港买手表哪里好,打分:0.9843372106552124
相似文本:在杭州手机到哪里买,打分:0.45211508870124817
相似文本:胡子长得快怎么办?,打分:0.19985519349575043
相似文本:怎样使胡子不浓密!,打分:0.18558596074581146

Langchain

Load and inference Dmeta-embedding via langchain as following:

pip install -U langchain
import torch
import numpy as np
from langchain.embeddings import HuggingFaceEmbeddings

model_name = "DMetaSoul/Dmeta-embedding"
model_kwargs = {'device': 'cuda' if torch.cuda.is_available() else 'cpu'}
encode_kwargs = {'normalize_embeddings': True} # set True to compute cosine similarity

model = HuggingFaceEmbeddings(
    model_name=model_name,
    model_kwargs=model_kwargs,
    encode_kwargs=encode_kwargs,
)

texts1 = ["胡子长得太快怎么办?", "在香港哪里买手表好"]
texts2 = ["胡子长得快怎么办?", "怎样使胡子不浓密!", "香港买手表哪里好", "在杭州手机到哪里买"]

embs1 = model.embed_documents(texts1)
embs2 = model.embed_documents(texts2)
embs1, embs2 = np.array(embs1), np.array(embs2)

similarity = embs1 @ embs2.T
print(similarity)

for i in range(len(texts1)):
    scores = []
    for j in range(len(texts2)):
        scores.append([texts2[j], similarity[i][j]])
    scores = sorted(scores, key=lambda x:x[1], reverse=True)

    print(f"查询文本:{texts1[i]}")
    for text2, score in scores:
        print(f"相似文本:{text2},打分:{score}")
    print()

HuggingFace Transformers

Load and inference Dmeta-embedding via HuggingFace Transformers as following:

pip install -U transformers
import torch
from transformers import AutoTokenizer, AutoModel

def mean_pooling(model_output, attention_mask):
    token_embeddings = model_output[0] #First element of model_output contains all token embeddings
    input_mask_expanded = attention_mask.unsqueeze(-1).expand(token_embeddings.size()).float()
    return torch.sum(token_embeddings * input_mask_expanded, 1) / torch.clamp(input_mask_expanded.sum(1), min=1e-9)

def cls_pooling(model_output):
    return model_output[0][:, 0]

texts1 = ["胡子长得太快怎么办?", "在香港哪里买手表好"]
texts2 = ["胡子长得快怎么办?", "怎样使胡子不浓密!", "香港买手表哪里好", "在杭州手机到哪里买"]

tokenizer = AutoTokenizer.from_pretrained('DMetaSoul/Dmeta-embedding')
model = AutoModel.from_pretrained('DMetaSoul/Dmeta-embedding')
model.eval()

with torch.no_grad():
    inputs1 = tokenizer(texts1, padding=True, truncation=True, return_tensors='pt')
    inputs2 = tokenizer(texts2, padding=True, truncation=True, return_tensors='pt')

    model_output1 = model(**inputs1)
    model_output2 = model(**inputs2)
    embs1

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 AFQMCcos_sim_pearson65.608
STSMTEB AFQMCcos_sim_spearman71.129
STSMTEB AFQMCeuclidean_pearson70.181
STSMTEB AFQMCeuclidean_spearman71.129
STSMTEB AFQMCmanhattan_pearson70.145
STSMTEB AFQMCmanhattan_spearman71.052
STSMTEB ATECcos_sim_pearson65.524
STSMTEB ATECcos_sim_spearman64.642
STSMTEB ATECeuclidean_pearson73.202
STSMTEB ATECeuclidean_spearman64.642
STSMTEB ATECmanhattan_pearson73.228
STSMTEB ATECmanhattan_spearman64.626
ClassificationMTEB AmazonReviewsClassification (zh)accuracy44.926
ClassificationMTEB AmazonReviewsClassification (zh)f142.826
STSMTEB BQcos_sim_pearson71.352
STSMTEB BQcos_sim_spearman72.296
STSMTEB BQeuclidean_pearson70.946
STSMTEB BQeuclidean_spearman72.296
STSMTEB BQmanhattan_pearson70.845
STSMTEB BQmanhattan_spearman72.245
ClusteringMTEB CLSClusteringP2Pv_measure40.242
ClusteringMTEB CLSClusteringS2Sv_measure39.168
RerankingMTEB CMedQAv1map88.488
RerankingMTEB CMedQAv1mrr90.369

Using it via the API

Call it like any OpenAI endpoint

Once AxForge deploys dmeta-embedding-zh for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (dmeta-embedding-zh 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":"dmeta-embedding-zh","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.

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