Downloads · 30 days
44
11% of all-time downloads
enver/aynengine-qwen3-0.6b-mantiq
aynengine-qwen3-0.6b-mantiq is a text generation model from enver. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as other.
AynEngine-Qwen3-0.6B-Mantiq is a specialized sovereign language model grounded in Classical Arabic morphology (Sarf) and Ghazalian deductive logic (Mantiq al-Burhan). Fine-tuned from Qwen/Qwen3-0.6B, this model featur…
Downloads · 30 days
44
11% of all-time downloads
All-time downloads
416
Public
Parameters
605M
1.2 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.2 GB · 98%
From the Hugging Face model README
AynEngine-Qwen3-0.6B-Mantiq is a specialized sovereign language model grounded in Classical Arabic morphology (Sarf) and Ghazalian deductive logic (Mantiq al-Burhan). Fine-tuned from Qwen/Qwen3-0.6B, this model features an expanded vocabulary of 160,807 tokens, specialized morphological root tokens (<root_XXX>), and a Direct Preference Optimization (DPO) alignment stage that reinforces demonstrative proof (Burhan) while unlearning sophistry and circular fallacies (Safsatah).
Designed specifically for on-device and edge deployment, the standalone model weighs only ~1.15 GB in bfloat16 and quantizes to ~340 MB in 4-bit GGUF, enabling sub-millisecond root extraction and offline inference on mobile devices, embedded routers, and single-board computers.
The standard Qwen3 vocabulary (151,936 tokens) was expanded by +8,871 specialized linguistic and epistemic tokens:
<root_كتب>, <root_علم>, <root_برهن>, etc.) derived from canonical dictionaries (Lisan al-Arab, Kitab al-Ayn).<wazn_فاعل>, <wazn_مفعول>, <wazn_استفعال>, etc.).<mantiq_burhan>, <mantiq_safsatah>, <mantiq_dawr_batil>, etc.).The model was trained through a two-stage cognitive curriculum inspired by Abu Hamid al-Ghazali's Mi'yar al-Ilm (The Standard of Knowledge) and Al-Qistas al-Mustaqim (The Correct Balance):
The internal reasoning architecture integrates the 5 Classical Arabic lexicographical disciplines:
| Evaluation Domain | Metric | Result |
|---|---|---|
| Sarf Root Extraction | Canonical Root Coverage (Lisan clean) | 84.21% Precision (0.7ms latency) |
| Tokenizer Lossless Integrity | Roundtrip String Equivalence | 100.0% Exact Match |
| Mantiq DPO Preference | Burhan vs Safsatah Discriminative Margin | +3.2168 Margin (96.08% Confidence) |
| Code Syntactic Integrity | Python Abstract Syntax Tree (AST parse) | 100.0% Pass Rate |
| Google MBPP Benchmark | Tuple Intersection Task (#2 Sanitized) | 100.0% Pass@1 (5.81s) |
| CPU Generation Speed | 16 Threads on x86_64 CPU | 10.5 - 11.4 tokens/sec |
| Memory Footprint | Active RAM in bfloat16 | 1.18 GB RAM (quantizable to ~340 MB) |
pip install transformers torch peft
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "path/to/aynengine-qwen3-0.6b-mantiq"
# 1. Load Tokenizer & Model
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto"
)
# 2. Format Prompt with Mantiq Epistemic Boundaries
prompt = "Analyze the logical proof: All humans are rational beings. Zaid is human. Therefore Zaid is rational."
chat = [
{"role": "system", "content": "You are a Ghazali Mantiq evaluator. Verify if the deduction constitutes Burhan."},
{"role": "user", "content": prompt}
]
inputs = tokenizer.apply_chat_template(chat, return_tensors="pt", add_generation_prompt=True)
outputs = model.generate(inputs, max_new_tokens=150, temperature=0.2)
response = tokenizer.decode(outputs[0][inputs.shape[1]:], skip_special_tokens=True)
print(response)
# The tokenizer automatically parses root boundaries
text = "استكشاف البرهان المنطقي"
# Decomposes into roots: <root_كشف>, <root_برهن>, <root_نطق>
Due to its compact 609M parameter architecture, this model can be converted to GGUF format for real-time edge execution:
# Convert to GGUF using llama.cpp
python convert_hf_to_gguf.py path/to/aynengine-qwen3-0.6b-mantiq --outtype q4_k_m
# Run on CPU with sub-second latency
./llama-cli -m aynengine-qwen3-0.6b-mantiq.Q4_K_M.gguf -p "مقدمة البرهان:" -n 128 -t 4
<think>...</think>) to prevent the model from assuming sound structure.Qwen/Qwen3-0.6B by Qwen TeamThis model, its architecture (including BPE-Free Farāhīdian/Sībawayhian tokenization, RootAttention, and Ishtiqāq-Attention), and its weights are released under the AynEngine & University of Prishtina Sovereign Academic License.
LICENSE in this repository.