Instructions to use enver/aynengine-v3-arabic-standalone with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use enver/aynengine-v3-arabic-standalone with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="enver/aynengine-v3-arabic-standalone") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("enver/aynengine-v3-arabic-standalone") model = AutoModelForCausalLM.from_pretrained("enver/aynengine-v3-arabic-standalone", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use enver/aynengine-v3-arabic-standalone with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "enver/aynengine-v3-arabic-standalone" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "enver/aynengine-v3-arabic-standalone", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/enver/aynengine-v3-arabic-standalone
- SGLang
How to use enver/aynengine-v3-arabic-standalone with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "enver/aynengine-v3-arabic-standalone" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "enver/aynengine-v3-arabic-standalone", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "enver/aynengine-v3-arabic-standalone" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "enver/aynengine-v3-arabic-standalone", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use enver/aynengine-v3-arabic-standalone with Docker Model Runner:
docker model run hf.co/enver/aynengine-v3-arabic-standalone
- AynEngine V3: Pure Classical Arabic Sovereign LLM & Next-Root Epistemic Engine
AynEngine V3: Pure Classical Arabic Sovereign LLM & Next-Root Epistemic Engine
AynEngine-V3-Arabic-Standalone is a specialized sovereign language model trained on 72 Classical Arabic Masterworks (83 MB, 9.17 Million Words, ~15.4 Million Tokens) and equipped with an independent 9,057-dimensional Epistemic Next-Root Invariant Head (RootPredictionHead).
Merging Ghazalian demonstrative logic (Mantiq al-Burhan) and Razian philosophical dialectics (Al-Matalib al-'Aliyah) with the foundational grammatical and lexical treatises of Arabic (Kitab Sibawayh, Kitab al-'Ayn, Lisan al-Arab), AynEngine V3 operates as a dual-stream cognitive engine:
- The Epistemic Invariant Stream: Predicts the next semantic root milestone across all 9,057 canonical Arabic roots in 176 milliseconds.
- The Surface Text Stream: Autoregressively generates grammatically rigorous Classical Arabic (al-Fusha al-Turathiyya) and structured reasoning code.
1. The Classical Heritage Training Corpus (72 Masterworks)
AynEngine V3 was fine-tuned across 82.98 MB of authentic classical manuscripts curated from local scholarly archives:
A. Imam Abu Hamid al-Ghazali (11.7 MB, 1.83M Words)
- Ihya' 'Ulum al-Din: Complete 40 Books across all four quarters (Rub' al-'Ibadat, Rub' al-'Adat, Rub' al-Muhlikat, Rub' al-Munjiyat).
- Tahafut al-Falasifa (The Incoherence of the Philosophers).
- Al-Iqtisad fi al-I'tiqad (Moderation in Belief).
- Al-Mustasfa min 'Ilm al-Usul (The Distillation of Jurisprudential Logic).
- Al-Maqsad al-Asna fi Sharh Asma' Allah al-Husna.
- Al-Mankhul min Ta'liqat al-Usul.
- Mishkat al-Anwar (The Niche of Lights).
B. Imam Fakhr al-Din al-Razi (36.8 MB, 4.12M Words)
- Al-Matalib al-'Aliyah min al-'Ilm al-Ilahi: Complete 9 Volumes (The pinnacle of Islamic philosophical theology and epistemology).
- Mafatih al-Ghayb (Al-Tafsir al-Kabir): 27 MB unabridged exegesis.
- Al-Mahsul fi 'Ilm Usul al-Fiqh (Volumes 1 through 6).
- Kitab al-Arba'in fi Usul al-Din.
- Lawami' al-Bayyinat fi al-Asma' wa al-Sifat.
- Asas al-Taqdis.
- Asrar al-Tanzil wa Anwar al-Ta'wil.
- 'Ismat al-Anbiya'.
C. Foundational Lexicons & Grammar (15.5 MB, 1.95M Words)
- Kitab Sibawayh: Complete 2.47 MB seminal treatise on Arabic grammar, phonology, and syntactic governance (al-'Amil wa al-Ma'mul).
- Kitab al-'Ayn (Al-Khalil ibn Ahmad al-Farahidi): Complete 4 Volumes (4.1 MB), the first systematic dictionary based on phonetic-permutational root analysis.
- Lisan al-Arab (Ibn Manzur): 346,573 canonical root and lexical entries.
D. Mystical & Scholastic Masterworks (18.7 MB, 1.27M Words)
- Al-Futuhat al-Makkiyya (Shaykh al-Akbar Muhyiddin Ibn 'Arabi): Complete 16.55 MB treatise on metaphysical cosmology and ontological states.
- Al-Shifa bi-Ta'rif Huquq al-Mustafa (Qadi 'Iyad): Complete 2.15 MB masterwork.
2. Dual-Stream Epistemic Architecture
Unlike standard Transformers that operate purely on statistical subwords, AynEngine V3 incorporates a dedicated Hierarchical Root Projection:
Input Prompt / Context
│
▼
[ Transformer Hidden Representation h_t (Dim: 1024) ]
│
├───► [ Epistemic Root Head (1024 -> 9057) ] ───► P(Root Invariant) in 176 ms
│ [Top-3 Invariant Milestones]
│
└───► [ Surface LM Head (1024 -> 160807) ] ───► P(Surface Tokens) at ~11.5 TPS
[Grammatical Prose & Code]
Next-Root Invariant Head (v3_root_head.pt)
- Linear projection from transformer hidden state ($d=1024$) to the 9,057 canonical roots ($d=9057$).
- Trained on 2,500 authentic classical root transition sequences.
- Top-5 Root Accuracy: 40.1% across 9,057 classes.
- Inference Latency: 176 ms on CPU (single forward pass).
Semantic Concept Transfer
During benchmarks, the root prediction head demonstrated spontaneous semantic mapping to modern technical concepts:
- Palindrome (Symmetry / Self-Reflection): Predicted
ذات(essence / self-identity) with 25.51% confidence. - Text De-noising & Diacritic Normalization: Predicted
صفا(purification / filtering) with 52.32% confidence. - Logical Syllogism (Deduction): Predicted
صفا(clear distinction) with 55.19% confidence. - Binary Search (Sorted Ordering & Pointers): Predicted
صفا(order) andرسم(indexing/tracing).
3. Epistemic Refusal Protocol (Qawa'id al-Burhan)
In alignment with classical Islamic epistemology:
"من قال لا أدري فقد أفتى" ("Whoever says 'I do not know' has demonstrated true knowledge.")
AynEngine V3 incorporates an explicit anti-hallucination constraint. When queried about citations or factual records outside its verified weights, it is calibrated to output:
"I do not know. I lack verified records for this."
rather than confabulating synthetic book titles or attributions.
4. Benchmark Performance
Tested on dual-socket Intel Xeon Gold 6226R CPU (64 cores, AVX-512):
| Metric | Measured Value | Note |
|---|---|---|
| Model Size | 1.2 GB (model.safetensors) |
Standalone merged, no adapter required |
| Vocabulary Size | 160,807 tokens | 151,750 base + 9,057 <root_XXX> tokens |
| Next-Root Head Size | 36 MB (v3_root_head.pt) |
1024 -> 9057 float32 weights |
| Root Prediction Latency | 176 ms | Single forward pass on CPU |
| 5-Root Invariant Trajectory | 865 ms | Conceptual reasoning sequence |
| CPU Generation Throughput | 11.41 tokens/sec (16 Threads) | Host utilization < 25% |
| Peak CPU Throughput | 11.60 tokens/sec (24 Threads) | Host utilization ~ 37% |
| Python AST Integrity | 100% Valid Syntax | Zero catastrophic forgetting on code |
5. Quickstart & Usage
Installation
pip install transformers torch
Loading the Standalone Merged Model
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "enver/aynengine-v3-arabic-standalone"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.float32)
prompt = (
"<|im_start|>system\n"
"أنت 'عين إنجن' (AynEngine v3)، النموذج السيادي المستند إلى المنطق البرهاني وجذور اللسان العربي الأصيل. "
"قدّم أجوبة محررة دقيقة باللغة العربية الفصحى الرصينة.<|im_end|>\n"
"<|im_start|>user\n"
"ما هو تعريف العلم عند الإمام أبي حامد الغزالي؟<|im_end|>\n"
"<|im_start|>assistant\n"
)
inputs = tokenizer(prompt, return_tensors="pt")
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=250,
temperature=0.2,
do_sample=True,
pad_token_id=tokenizer.eos_token_id
)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
Loading with the Next-Root Head
import torch
import torch.nn as nn
import torch.nn.functional as F
from transformers import AutoModelForCausalLM, AutoTokenizer
# 1. Load base model & tokenizer
model = AutoModelForCausalLM.from_pretrained("enver/aynengine-v3-arabic-standalone", torch_dtype=torch.float32)
tokenizer = AutoTokenizer.from_pretrained("enver/aynengine-v3-arabic-standalone")
# 2. Load 1024 -> 9057 Root Head
root_head = nn.Linear(1024, 9057, bias=False)
root_head.load_state_dict(torch.load("v3_root_head.pt", map_location="cpu"))
root_head.eval()
# 3. Predict Next-Root Invariant
inputs = tokenizer("البرهان في النظر العقلي", return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs, output_hidden_states=True)
last_hidden = outputs.hidden_states[-1][:, -1, :]
root_logits = root_head(last_hidden)
top_root_probs, top_root_indices = torch.topk(F.softmax(root_logits[0], dim=-1), k=3)
print("Top Predicted Root Indices:", top_root_indices.tolist())
print("Top Root Probabilities:", top_root_probs.tolist())
6. Citation & Scholarly Attribution
@misc{aynengine_v3_2026,
author = {AynEngine Sovereign Research Team},
title = {AynEngine V3: Pure Classical Arabic Sovereign LLM and Next-Root Epistemic Architecture},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/enver/aynengine-v3-arabic-standalone}}
}
- Downloads last month
- 296