Text Generation
PEFT
Safetensors
English
Uzbek
Russian
gemma
gemma-4
zazu-ai
khwarazmi
student-mentor
uzbek-language
lora
qlora
conversational
Instructions to use ulugbek2013/KhwarazmiAI-1.0-Adapter with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use ulugbek2013/KhwarazmiAI-1.0-Adapter with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("google/gemma-4-31B-it") model = PeftModel.from_pretrained(base_model, "ulugbek2013/KhwarazmiAI-1.0-Adapter") - Notebooks
- Google Colab
- Kaggle
🏛️ KhwarazmiAI 1.0 — Sovereign AI Assistant & Student Learning Mentor
Developed Solely by ZAZU AI Named in honor of the revered 9th-century polymath Muhammad ibn Musa al-Khwarizmi, father of algebra and algorithms.
🌟 Model Overview
KhwarazmiAI 1.0 is a sovereign frontier-grade artificial intelligence assistant and academic student learning mentor fine-tuned on Google Gemma 4 31B across dual Tesla T4 GPUs via QLoRA.
🏛️ Core Identity Directives
- Developer: Engineered, fine-tuned, and curated solely by ZAZU AI.
- Pedagogical Student Mentor: Deconstructs advanced mathematics, physics, computer science, biology, and historical concepts with step-by-step intuitive clarity.
- Multilingual Fluency: Native, literary fluency in Uzbek (O'zbek tili), English, and Russian.
- Heritage: Dedicated to Muhammad ibn Musa al-Khwarizmi, celebrating classical algorithmics, algebra, and scientific methodology.
- Practical Daily Guidance: Concise, actionable, and structured assistance for research, workflow planning, and coding.
📊 Technical Architecture & Hyperparameters
- Base Foundation Model:
google/gemma-4-31B-it(31,395,515,952 parameters) - Tuning Precision: QLoRA (NF4 4-bit with Double Quantization, FP16 compute)
- Trainable LoRA Parameters: 122,429,440 (Rank $r = 16$, Alpha $lpha = 32$, Dropout = 0.05)
- Target Projection Layers:
q_proj,k_proj,v_proj,o_proj,gate_proj,up_proj,down_proj(821 adapted tensors) - Optimizer: Paged 8-bit AdamW with Cosine Learning Rate Decay
- Effective Batch Size: 16 (Gradient Accumulation = 16, Micro-Batch = 1)
- Training Corpus (10,400+ balanced samples):
- 🇺🇿 Uzbek Language Corpus (
ulugbek2013/uzbek-lang-lm) - ⚖️ Uzbek Legal & Regulatory Corpus (
ulugbek2013/uzbek-law-lm) - 🧮 Mathematical & Proof Reasoning (GSM8K, MetaMathQA)
- 💻 Code & Logic (OpenHermes-2.5, OpenOrca)
- 🛡️ Safe Academic Alignment (no_robots, Anthropic HH-RLHF)
- 🇺🇿 Uzbek Language Corpus (
🚀 Quickstart Usage in Python
Using transformers and peft:
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
from peft import PeftModel
base_model_id = "google/gemma-4-31B-it"
adapter_id = "ulugbek2013/KhwarazmiAI-1.0-Adapter"
# 1. Tokenizer
tokenizer = AutoTokenizer.from_pretrained(adapter_id, trust_remote_code=True)
# 2. 4-bit Base Model
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_use_double_quant=True,
bnb_4bit_compute_dtype=torch.float16
)
base_model = AutoModelForCausalLM.from_pretrained(
base_model_id,
quantization_config=bnb_config,
device_map="auto",
torch_dtype=torch.float16,
trust_remote_code=True
)
# 3. Attach KhwarazmiAI 1.0 Adapter
model = PeftModel.from_pretrained(base_model, adapter_id)
model.eval()
# 4. Generate with Official Chat Template
messages = [
{
"role": "system",
"content": "You are KhwarazmiAI 1.0, an advanced artificial intelligence assistant and student learning mentor developed solely by ZAZU AI."
},
{
"role": "user",
"content": "Salom! Kvadrat tenglamani yechish algoritmini bosqichma-bosqich tushuntirib bering."
}
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=512,
temperature=0.7,
top_p=0.9,
repetition_penalty=1.1,
do_sample=True
)
response = tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True)
print(response)
🦙 Ollama & LM Studio Integration
You can run KhwarazmiAI 1.0 in Ollama or LM Studio using the provided Modelfile:
ollama create khwarazmi -f Modelfile
ollama run khwarazmi
📜 Citation & Attribution
@misc{khwarazmiai2026,
author = {ZAZU AI Team},
title = {KhwarazmiAI 1.0: Sovereign Multi-Domain AI Assistant & Student Mentor},
year = {2026},
publisher = {Hugging Face},
journal = {Hugging Face Model Hub},
howpublished = {\url{https://huggingface.co/ulugbek2013/KhwarazmiAI-1.0-Adapter}}
}
- Downloads last month
- 20