Zen Embeddings
Collection
Embedding model family for RAG and semantic search. • 7 items • Updated
How to use zenlm/zen-reranker with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="zenlm/zen-reranker") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("zenlm/zen-reranker")
model = AutoModelForCausalLM.from_pretrained("zenlm/zen-reranker")Zen Reranker is a high-performance reranking model for search and retrieval pipelines. Part of the Zen AI model family by Hanzo AI.
Zen Reranker is optimized for:
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification
model_name = "zenlm/zen-reranker"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name, torch_dtype=torch.float16)
def rerank(query, passages):
pairs = [[query, p] for p in passages]
inputs = tokenizer(
pairs, padding=True, truncation=True,
max_length=512, return_tensors="pt"
)
with torch.no_grad():
scores = model(**inputs).logits.squeeze(-1)
ranked = sorted(zip(passages, scores.tolist()), key=lambda x: x[1], reverse=True)
return ranked
query = "What is the capital of France?"
passages = ["Paris is the capital of France.", "Berlin is in Germany.", "Madrid is in Spain."]
results = rerank(query, passages)
for passage, score in results:
print(f"{score:.3f}: {passage}")
from sentence_transformers import CrossEncoder
model = CrossEncoder("zenlm/zen-reranker")
scores = model.predict([
["What is the capital of France?", "Paris is the capital of France."],
["What is the capital of France?", "Berlin is in Germany."],
])
| Attribute | Value |
|---|---|
| Parameters | 4B |
| Architecture | Qwen3ForSequenceClassification |
| Context | 32,768 tokens |
| Languages | 100+ (multilingual) |
| License | Apache 2.0 |
Like all Zen models, Zen Reranker is abliterated — refusal bias has been removed using directional ablation via hanzoai/remove-refusals.
Technique: Refusal in LLMs is mediated by a single direction — Arditi et al.
| Model | Parameters | Use Case |
|---|---|---|
| Zen Nano | 0.6B | Edge AI |
| Zen Scribe | 4B | Writing |
| Zen Pro | 8B | Professional AI |
| Zen Reranker | 4B | Retrieval |
| Zen Embedding | — | Embeddings |
@misc{zen-reranker-2025,
title={Zen Reranker: High-Performance Neural Reranking},
author={Hanzo AI and Zoo Labs Foundation},
year={2025},
url={https://huggingface.co/zenlm/zen-reranker}
}
Part of the Zen model ecosystem by Hanzo AI (Techstars '17) and Zoo Labs Foundation.