BLACK0X80/horus-egy-coder
127
1---2language:3- ar4- en5license: apache-2.06base_model: meta-llama/Llama-3.1-8B7tags:8- llama9- arabic10- egyptian11- coding12- text-generation13- conversational14- unsloth15- trl16- fine-tuned17pipeline_tag: text-generation18library_name: transformers19---20 21# Horus-Egy-Coder22 23**Egyptian Arabic coding assistant** — a fine-tuned Llama 3.1-8B model specialized in helping Arabic and Egyptian developers write, debug, and understand code.24 25> Built in Egypt 🇪🇬 | Powered by [Unsloth](https://github.com/unslothai/unsloth) + TRL26 27---28 29## Model Description30 31`horus-egy-coder` is a fine-tuned version of `meta-llama/Llama-3.1-8B-Instruct` trained to assist Arabic-speaking developers — with native understanding of Egyptian Arabic technical dialect. It can explain code in Arabic, help debug in conversational Egyptian, and write clean code with Arabic comments.32 33| Property | Value |34|---|---|35| **Base model** | meta-llama/Llama-3.1-8B-Instruct |36| **Parameters** | 1B (quantized BF16) |37| **Training** | Unsloth + HuggingFace TRL (2x faster) |38| **License** | Apache 2.0 |39| **Language** | Arabic 🇪🇬 / English |40| **Task** | Code generation, explanation, debugging |41 42---43 44## Quick Start45 46```python47from transformers import AutoTokenizer, AutoModelForCausalLM48import torch49 50model_name = "BLACK0X80/horus-egy-coder"51 52tokenizer = AutoTokenizer.from_pretrained(model_name)53model = AutoModelForCausalLM.from_pretrained(54 model_name,55 torch_dtype=torch.bfloat16,56 device_map="auto"57)58 59messages = [60 {61 "role": "system",62 "content": "أنت مساعد برمجة بيتكلم عربي مصري. بتشرح الكود بالعربي وبتساعد المطورين."63 },64 {65 "role": "user", 66 "content": "اكتبلي function بـ Python بتحسب الـ factorial"67 }68]69 70input_ids = tokenizer.apply_chat_template(71 messages,72 tokenize=True,73 add_generation_prompt=True,74 return_tensors="pt"75).to(model.device)76 77output = model.generate(78 input_ids,79 max_new_tokens=512,80 temperature=0.7,81 do_sample=True82)83 84print(tokenizer.decode(output[0][input_ids.shape[1]:], skip_special_tokens=True))85```86 87---88 89## Example Interactions90 91**Example 1 — Code explanation in Arabic:**92```93User: فسرلي الكود ده94 for i in range(len(arr)-1):95 for j in range(len(arr)-i-1):96 if arr[j] > arr[j+1]:97 arr[j], arr[j+1] = arr[j+1], arr[j]98 99Model: ده Bubble Sort — خوارزمية ترتيب بسيطة.100 بتعمل loop على الـ array وبتقارن كل عنصر بالي بعده،101 لو العنصر الأكبر جه الأول بتبدلهم...102```103 104**Example 2 — Debugging:**105```106User: الكود ده بيطلع IndexError، مش عارف ليه107Model: المشكلة في السطر ده... جرب كذا...108```109 110---111 112🔢 GGUF Version (للأجهزة المحدودة)113 114لو جهازك مش عنده GPU كبير، استخدم النسخة المضغوطة:115 116 [`BLACK0X80/horus-egy-coder-Q4_K_M-GGUF`](https://huggingface.co/BLACK0X80/horus-egy-coder-Q4_K_M-GGUF)117 118```bash119# تشغيل بـ llama.cpp120./llama-cli -m horus-egy-coder-Q4_K_M.gguf \121 -p "أنت مساعد برمجة عربي مصري." \122 --chat-format llama-3123```124 125---126 127## Training Details128 129- **Framework:** [Unsloth](https://github.com/unslothai/unsloth) (2x faster training, 60% less memory)130- **Library:** HuggingFace TRL (SFT Trainer)131- **Base:** `unsloth/Meta-Llama-3.1-8B-Instruct-bnb-4bit`132- **Quantization:** BF16133 134---135 136## Intended Use137 138 **Good for:**139- شرح الكود بالعربي المصري140- كتابة functions وscripts بـ Python141- Debugging مع تفسير الأخطاء بالعربي142- تعليم البرمجة للمبتدئين العرب143 144 **Limitations:**145- النموذج fine-tuned على بيانات محدودة — ممكن يغلط في كود معقد جداً146- مش متخصص في لغات غير Python بنفس الكفاءة147- مش مناسب لـ production code بدون مراجعة بشرية148 149---150 151## About HORUS-AI152 153HORUS-AI is an Egyptian AI initiative focused on building Arabic and Egyptian-dialect AI models. Named after the ancient Egyptian god of knowledge, we aim to make AI accessible to Arabic-speaking developers.154 155- GitHub: [BLACK0X80](https://github.com/BLACK0X80)156- Web: [black0x80.vercel.app](https://black0x80.vercel.app)157 158---159 160## Citation161 162```bibtex163@misc{horus-egy-coder-2025,164 title={Horus-Egy-Coder: Egyptian Arabic Coding Assistant},165 author={BLACK0X80 and HORUS-AI},166 year={2025},167 url={https://huggingface.co/BLACK0X80/horus-egy-coder},168 note={Fine-tuned from meta-llama/Llama-3.1-8B-Instruct}169}170```171 172---173 174*Made with ❤️ in Egypt 🇪🇬*