Instructions to use flintglass/PrismEmbed-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use flintglass/PrismEmbed-4B with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("flintglass/PrismEmbed-4B") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
Flintglass PrismEmbed-4B
Flagship 4B, 32K-Context, 100+ Language, 100% Commercial-Safe (Zero MS MARCO!) Matryoshka Embedding Model β built on Apache-2.0 Qwen/Qwen3-Embedding-4B via LoRA (r=32) cross-GPU InfoNCE + listwise distillation from Qwen/Qwen3-Reranker-4B across permissive long-context groups + WiSE-FT model soup (alpha=0.45).
- #1 Dense Retrieval Model in the Flintglass Stack (
65.18%All-7 NDCG@10): Beats BaseQwen/Qwen3-Embedding-4Bby+2.09 pts(65.18%vs63.09%) and crushesBAAI/bge-m3by+8.28 pts(65.18%vs56.90%) across 7 strictly held-out zero-shot dense retrieval benchmarks! - +15.96 pts on LongDoc-8K (
85.98%vs70.02%Base,72.51%bge-m3): Unlocks frontier long-document dense retrieval on 2Kβ6K token documents. - 512d MRL Beats Full 2560d Base (
63.44%vs63.09%): At 5Γ smaller vector dimensions (512d),PrismEmbed-4BSTILL outperforms full2560dBaseQwen/Qwen3-Embedding-4Bβ and at 20Γ smaller128d(57.56%), it STILL beats full1024dBAAI/bge-m3(56.90%) by+0.66 pts(+12.17 pts vsbge-m3128d!)! - 100% Drop-In Compatible: Exact same
SentenceTransformerlast-token pooling,prompts={"query": ...}, andllama.cpp --pooling lastformat asQwen/Qwen3-Embedding-4B.
Part of the Flintglass Prism Open-Source Agent & RAG Stack Β· GGUF Quantizations:
flintglass/PrismEmbed-4B-GGUF(F16,Q8_0,Q4_K_M)
Verified Zero-Shot 7-Benchmark Dense Retrieval Leaderboard (Full-Corpus NDCG@10 %)
Evaluated identically with full-corpus dense retrieval (max_length=4096) across 7 strictly held-out benchmarks (zero overlap with training data):
| Model | Params | Dim | Ctx | SciFact | NFCorpus | FiQA | ArguAna | TREC-COVID | BEIR-5 | Mr.TyDi (11L) | LongDoc-8K | All-7 Avg | MRL 512d | MRL 256d | MRL 128d |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
BAAI/bge-m3 |
568M | 1024 | 8K | 61.97 | 31.34 | 34.48 | 46.99 | 62.87 | 47.53 | 88.11 | 72.51 | 56.90 | β | 51.05 | 45.39 |
Qwen/Qwen3-Embedding-0.6B |
600M | 1024 | 32K | 66.86 | 34.72 | 35.41 | 46.35 | 75.31 | 51.73 | 92.84 | 66.23 | 59.67 | β | 57.03 | 54.49 |
flintglass/PrismEmbed-0.6B |
600M | 1024 | 32K | 68.07 | 34.89 | 34.90 | 45.68 | 71.72 | 51.05 | 94.01 | 82.45 | 61.67 | 60.64 | 58.70 | 55.44 |
Qwen/Qwen3-Embedding-4B (Base) |
4B | 2560 | 32K | 72.73 | 37.29 | 40.27 | 48.37 | 76.49 | 55.03 | 96.47 | 70.02 | 63.09 | 61.35 | 58.98 | 55.76 |
flintglass/PrismEmbed-4B |
4B | 2560 | 32K | 73.41 | 37.23 | 39.92 | 47.91 | 74.88 | 54.67 | 96.96 | 85.98 | 65.18 | 63.44 | 61.00 | 57.56 |
| Delta vs Base 4B | β | β | β | +0.68 | -0.06 | -0.35 | -0.46 | -1.61 | -0.36 | +0.49 | +15.96 | +2.09 | +2.09 | +2.02 | +1.80 |
Full Matryoshka All-7 NDCG@10 sweep: 2560d: 65.18% Β· 1024d: 64.63% Β· 512d: 63.44% Β· 256d: 61.00% Β· 128d: 57.56%.
Quickstart (sentence-transformers)
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("flintglass/PrismEmbed-4B")
queries = ["How does Matryoshka Representation Learning shrink vector database RAM?"]
docs = [
"Matryoshka Representation Learning trains embeddings so leading prefixes (512d, 256d, 128d) preserve retrieval quality, reducing vector memory 5x-20x.",
"The Eiffel Tower is a wrought-iron lattice tower in Paris, France.",
]
q_emb = model.encode(queries, prompt_name="query", normalize_embeddings=True)
d_emb = model.encode(docs, normalize_embeddings=True)
print("Cosine similarities (2560d):", (q_emb @ d_emb.T)[0].tolist())
# 512d Matryoshka truncation (5x smaller index, STILL beats full 2560d Base!)
q_512 = model.encode(queries, prompt_name="query", truncate_dim=512, normalize_embeddings=True)
d_512 = model.encode(docs, truncate_dim=512, normalize_embeddings=True)
print("Cosine similarities (512d):", (q_512 @ d_512.T)[0].tolist())
Local Inference (llama.cpp / Ollama / GGUF)
See flintglass/PrismEmbed-4B-GGUF (F16, Q8_0, Q4_K_M) for verified llama-embedding and llama-server --embedding quantizations!
Training & Commercial-Safe Provenance
- Base Model:
Qwen/Qwen3-Embedding-4B(Apache-2.0, 32K context, 100+ languages) - Teacher:
Qwen/Qwen3-Reranker-4B(Apache-2.0) - Training Data: Strictly permissive commercial-safe long-context corpus (zero MS MARCO, zero CC-BY-NC, zero proprietary API distillation).
- Method: LoRA (
r=32, merged cleanly to BF16) cross-GPU all-gathered InfoNCE + listwise KL distillation + Matryoshka loss (2560/1024/512/256/128) + WiSE-FT model soup (alpha=0.45). - License: Apache-2.0
- Downloads last month
- -