Duchifat-2.1-Instruct is a specialized Small Language Model (SLM) developed by razielAI at TopAI. The project aims to bridge the gap between compact model efficiency and high-density reasoning in bilingual (Hebrew/English) environments.
This model is a Full Parameter Fine-Tuned (FPFT) version of the Duchifat-2 architecture, specifically designed to serve as a baseline for instruction-following tasks, technical scripting, and brand-aligned communication.
The model is optimized for software engineering workflows, including:
Duchifat-2.1-Instruct is trained to represent the TopAI professional persona. It maintains a consistent "Senior Consultant" tone in Hebrew, making it suitable for internal automation and customer-facing interfaces.
The model's training emphasized "Faithfulness to Prompt," which is a critical requirement for RAG systems. It is designed to act as a synthesizer of external knowledge bases.
pip install transformers torch accelerate
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
# 1. ืืืืจืืช ืืืืื ืื-Hub
model_id = "razielAI/Duchifat-2.1-Instruct"
device = "cuda" if torch.cuda.is_available() else "cpu"
print(f"๐ ืืชืืื ืืขืื ื ืฉื {model_id} ืื-Hugging Face Hub...")
# 2. ืืขืื ืช ืืืงื ืืืืจ ืืืืื (ืขื trust_remote_code ืื ืื ืืืื ืืืชืื)
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_id,
trust_remote_code=True,
torch_dtype=torch.bfloat16,
device_map="auto" if device == "cuda" else None
).to(device)
model.eval()
def run_duchifat_inference(user_prompt):
# ืืคืืจืื ืืืืืืง ืฉืืืืื ืืืืจ ืืืืืืื
full_prompt = f"<instruction> {user_prompt} </instruction>\n<assistant> "
# ืืื ืช ื-Inputs
inputs = tokenizer(full_prompt, return_tensors="pt", add_special_tokens=False).to(device)
with torch.no_grad():
outputs = model.generate(
input_ids=inputs["input_ids"],
attention_mask=inputs["attention_mask"],
max_new_tokens=20, # ืืืืืชื ืืขื ืืืืืช ืชืฉืืืืช ืงืื ืืคืืจืืืช
do_sample=False, # ืืืจืืื ืืกืื ืืืืืช ืืืืง ืืื ื
repetition_penalty=4.5, # ืื ืืขืช ืืืจืชืืืช ืืืืื ืงืื
eos_token_id=tokenizer.eos_token_id,
pad_token_id=tokenizer.eos_token_id
)
# ืคืืขื ืื ืืืงืกื ืืืื
full_text = tokenizer.decode(outputs[0], skip_special_tokens=False)
# ืืืืืงืช ืืืืืฅ ื ืงืืื ืฉื ืืชืฉืืื ืืชืื ื-Tags
if "<assistant>" in full_text:
# ืืืงืืื ืื ืฉืื ืืืจื assistant ืืืืชืืื ื-eos ืื ืืกืืืจืช ืชืืืช
response = full_text.split("<assistant>")[-1]
response = response.replace("</assistant>", "").replace("<eos>", "").strip()
else:
response = full_text.strip()
return response
# --- ืืืืืช ืฆ'ืื ืืื ืืจืืงืืืืืช ---
print("\n" + "="*60)
print("๐ Duchifat-2.1-Instruct: Cloud Mode (Loaded from HF Hub)")
print("Identity: TopAI | Language: Hebrew & English | Ready for instructions.")
print("ืืงืื 'exit' ืื 'ืืฆืืื' ืืื ืืกืืื.")
print("="*60)
while True:
try:
user_input = input("\n๐ค You: ")
if user_input.lower() in ["exit", "quit", "ืืฆืืื"]:
print("\n๐ค Duchifat-2.1: Closing session. Standby for the next mission... ๐")
break
if not user_input.strip():
continue
# ืืจืฆืช ืืืื ืคืจื ืก
response = run_duchifat_inference(user_input)
# ืืืคืกืช ืืชืฉืืื
print(f"\n๐ค Duchifat-2.1: {response}")
except KeyboardInterrupt:
break
except Exception as e:
print(f"\nโ Runtime Error: {e}")
print("\n" + "="*60)
Note: Formal benchmarking and metric evaluation (e.g., MMLU, HumanEval) for this specific fine-tuned version are currently in progress.
Duchifat-2.1-Instruct's compact size makes it a prime candidate for:
TopAI is an AI research and development hub focused on practical, efficient, and aligned AI solutions.
Lead Developer: Raziel Organization: TopAI Status: Version 2.1.0-Instruct (Active Development)
Raziel1234/Duchifat-2