Downloads · 30 days
18
39% of all-time downloads
Yusiko/khazri-2
khazri-2 is a text classification model from Yusiko. Use it when you need a label for a piece of text. The card lists the license as apache-2.0.
<p align="center" <img src="./assets/khazri-2-preview-banner.png" alt="Khazri 2 Preview — flagship open-weight language model" width="100%" </p
Downloads · 30 days
18
39% of all-time downloads
All-time downloads
46
Public
Parameters
252M
1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1 GB · 100%
From the Hugging Face model README
Khazri 2 Preview is the flagship open-weight release in the current Khazri family. It combines the Khazri model with the project's SYNAPSE architecture and route-aware inference system for research, experimentation and controlled integration.
Hugging Face · Khazri · Contact
Preview release: Validate this model on your own tasks before production use. It should not be the sole basis for high-impact decisions.
| Item | Detail |
|---|---|
| Model | Khazri 2 Preview |
| Family position | Flagship model in the Khazri 2 generation |
| Parameters | ~250M; the release config is the final source of truth |
| Status | Open weights on Hugging Face |
| Architecture | Khazri model with SYNAPSE components |
| Safe export context limit | 512 tokens |
| Default maximum generation | 128 new tokens |
| Loading | Transformers with custom model code |
| Web-search route | Disabled by default |
The release includes the configuration, tokenizer, safetensor weights and the custom SYNAPSE model files required for the inference stack:
config.json
generation_config.json
model.safetensors
tokenizer.json
tokenizer_config.json
modeling_synapse.py
synapse_controller.py
inference.py
The route system supports:
Routing is implementation-dependent. Inspect the custom Python files before enabling remote code and pin a specific model revision in production.
Khazri 2 Preview does not state a source-level corpus mix in this model card. Do not assume that it uses the same sources, proportions or post-training process as Khazri 2 Mini.
For a particular release, use the data documentation and model revision published with the Khazri 2 Hugging Face repository. A complete data card should identify source datasets and licences, language coverage, filtering and deduplication steps, pre-training and instruction-tuning material, known limitations and revision-specific evaluation.
pip install -U torch transformers accelerate safetensors
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
MODEL_ID = "Yusiko/khazri-2"
# Inspect the model repository before enabling custom remote code.
tokenizer = AutoTokenizer.from_pretrained(
MODEL_ID,
trust_remote_code=True,
use_fast=True,
)
model = AutoModelForCausalLM.from_pretrained(
MODEL_ID,
torch_dtype="auto",
device_map="auto",
trust_remote_code=True,
)
prompt = "Summarize the following text in two concise sentences: ..."
inputs = tokenizer(prompt, return_tensors="pt", truncation=True, max_length=384)
inputs = {key: value.to(model.device) for key, value in inputs.items()}
with torch.inference_mode():
output = model.generate(
**inputs,
max_new_tokens=128,
do_sample=False,
pad_token_id=tokenizer.eos_token_id,
)
print(tokenizer.decode(output[0], skip_special_tokens=True))
For this preview export, reserve generation tokens within the 512-token total context limit. For example, use up to 384 input tokens with 128 new tokens.
The following values are project-provided internal results for Khazri 2 Preview across selected compact-model tests. Higher is better.
| Model | Parameters | Context extraction | Mixed speed/proxy | Arithmetic | Word problems | Abstention |
|---|---|---|---|---|---|---|
| Khazri 2 Preview | ~250M | 100% | 62% | 99% | 99% | 97.4% |
| Gemma 3 | 270M | 100% | 36% | 0% | 0% | 18% |
| Qwen 2.5 | 0.5B | 89% | 45% | 14% | 28% | 46% |
| Pythia | 160M | 22% | 10% | 0% | 2% | 1% |
These figures are not independently audited. They describe the reported test configuration only and do not establish general superiority or predict performance on every downstream task. Publish prompts, task definitions, scoring rules, model versions, seeds, hardware and full evaluation assets with future public benchmark claims.
Khazri 2 Preview may hallucinate, make reasoning errors, reflect training-data bias or abstain incorrectly. Use retrieval, verification and human review for consequential work. Do not rely on outputs alone for medical, legal, financial, security, safety, education, employment or other high-impact decisions.
Use the files, revision and licence stated on the Hugging Face model page as the source of truth for a specific release.
Khazri 2 Preview represents the current flagship stage. The next goal is Khazri 3: a model with a larger parameter count and stronger results.
To discuss research, integration or partnerships, visit khazri.dev or email [email protected].