Downloads · 30 days
0
Kabumbus/mdbr-leaf-mt-1536-onnx
mdbr-leaf-mt-1536-onnx is a machine learning model from Kabumbus. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
This repository folder contains a distilled SentenceTransformer embedding model exported to ONNX and additionally provided in INT8 ONNX and INT8 ORT formats for efficient deployment (including client-side scenarios).
Downloads · 30 days
0
Access
Public
Updated Dec 31, 2025
Repo size
330 MB
Likes
1
Public
Click a slice to open those files.
.onnx152 MB · 72%
From the Hugging Face model README
This repository folder contains a distilled SentenceTransformer embedding model exported to ONNX and additionally provided in INT8 ONNX and INT8 ORT formats for efficient deployment (including client-side scenarios).
Evaluation testing on Qdrant/dbpedia-entities-openai3-text-embedding-3-small-1536-100K:


The model was trained to approximate OpenAI text-embedding-3-small embeddings (1536-d) on the dataset:
Qdrant/dbpedia-entities-openai3-text-embedding-3-small-1536-100K and texts from Tabotea corpus (in all languages) - 3.5 mil unique records in total, 80gb of data.
text-embedding-3-small at 1536 dimensions. (e.g., in a web browser client)Pattern (1) is generally more stable. Pattern (2) is possible but has specific risks (see below).
use same tokeniser as for mdbr-leaf-mt to generate inputs, get OpenAI-styled embedding vectors
input_ids (int64) — shape [batch, seq]attention_mask (int64) — shape [batch, seq]token_type_ids (int64) — only if the exported model expects it (some backbones do)sentence_embedding (float32) — shape [batch, 1536]Exports are typically configured to output L2-normalized embeddings (normalized_output: true in export_meta.json).
The model was trained/exported with a fixed truncation policy (max_length=512).
max_length and truncation settings on all clients to avoid drift.model.onnx (float):
best fidelity
larger file, slower than quantized on CPU/WASM
model.int8.onnx (dynamic weight-only INT8):
smaller, faster on many CPU/WASM setups
slightly reduced fidelity vs float (usually small, but measurable)
model.int8.ort:
same intent as INT8 ONNX, packaged for ORT format workflows
typically used for minimal runtime deployments
If you plan production use, validate at the level that matters:
This model approximates OpenAI embeddings; it is not identical. If you embed documents with OpenAI and queries locally, ranking can degrade due to query-space mismatch, especially for near-ties.
Mitigation: Prefer “all-local” (both docs and queries with the same model), or add reranking / calibration.
User prompts are often short. Distilled models frequently exhibit larger relative errors on short inputs.
Mitigation: Evaluate on a real prompt distribution; consider prompting templates or query expansion if needed.
INT8 generally introduces a small but consistent quality drop vs float.
Mitigation: Use float ONNX for highest fidelity; use INT8 where latency/size dominate and retrieval tolerates minor loss.
Differences in max_length, truncation, whitespace cleanup, or normalization can materially change embeddings.
Mitigation: Lock preprocessing and document it; enforce consistent L2 normalization across query and doc vectors.
If server-side embeddings are re-generated with a different OpenAI model/version, the student alignment may degrade.
Mitigation: Version embeddings and keep a migration plan; retrain or recalibrate if the teacher changes.
Browsers vary in performance and capabilities. Cold-start cost, memory pressure, and backend differences (WASM/WebGPU) can cause inconsistent UX.
Mitigation: Use caching, lazy loading, fallbacks, and device-aware routing (server-side embedding for low-end clients).
MongoDB/mdbr-leaf-mt) and training datasets that have their own licenses/terms.If you need maximum relevance quality: use float ONNX and consider server-side embedding for queries.
If you need low-latency or offline mode: use INT8 ONNX client-side, but validate retrieval metrics and consider reranking.
For hybrid (client query + server doc embeddings):
Treat this as a performance optimisation that requires A/B validation
prefer larger top-K retrieval and reranking to compensate for the mismatch
This model is a student encoder trained to regress toward OpenAI text-embedding-3-small (1536-d) embeddings using embedding-level distillation.
MongoDB/mdbr-leaf-mt (SentenceTransformer).Dense head was replaced (or appended if missing) to output 1536 dimensions:bias=Falseactivation_function=Identity()To preserve the base semantic space while adapting the projection toward the teacher embeddings:
Schema was normalised to:
text (string)labels (float32[1536]) — teacher embeddingDataset handling:
The model was trained using a cosine regression objective against the teacher embeddings:
embemb_n = normalize(emb)lab_n = normalize(labels)loss = 1 - mean(sum(emb_n * lab_n))This directly optimises angular alignment between student and teacher vectors.
max_length = 512Key hyperparameters:
adamw_torch_fused)neftune_noise_alpha = 0.0)Precision and kernels:
On a single A100 80GB, training took 5hours.