Instructions to use rahimdzx/AraCode-7B-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use rahimdzx/AraCode-7B-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="rahimdzx/AraCode-7B-GGUF", filename="aracode-7b.Q4_K_M.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use rahimdzx/AraCode-7B-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf rahimdzx/AraCode-7B-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf rahimdzx/AraCode-7B-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf rahimdzx/AraCode-7B-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf rahimdzx/AraCode-7B-GGUF:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf rahimdzx/AraCode-7B-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf rahimdzx/AraCode-7B-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf rahimdzx/AraCode-7B-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf rahimdzx/AraCode-7B-GGUF:Q4_K_M
Use Docker
docker model run hf.co/rahimdzx/AraCode-7B-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use rahimdzx/AraCode-7B-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "rahimdzx/AraCode-7B-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rahimdzx/AraCode-7B-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/rahimdzx/AraCode-7B-GGUF:Q4_K_M
- Ollama
How to use rahimdzx/AraCode-7B-GGUF with Ollama:
ollama run hf.co/rahimdzx/AraCode-7B-GGUF:Q4_K_M
- Unsloth Studio new
How to use rahimdzx/AraCode-7B-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for rahimdzx/AraCode-7B-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for rahimdzx/AraCode-7B-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for rahimdzx/AraCode-7B-GGUF to start chatting
- Pi new
How to use rahimdzx/AraCode-7B-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf rahimdzx/AraCode-7B-GGUF:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "rahimdzx/AraCode-7B-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use rahimdzx/AraCode-7B-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf rahimdzx/AraCode-7B-GGUF:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default rahimdzx/AraCode-7B-GGUF:Q4_K_M
Run Hermes
hermes
- Docker Model Runner
How to use rahimdzx/AraCode-7B-GGUF with Docker Model Runner:
docker model run hf.co/rahimdzx/AraCode-7B-GGUF:Q4_K_M
- Lemonade
How to use rahimdzx/AraCode-7B-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull rahimdzx/AraCode-7B-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.AraCode-7B-GGUF-Q4_K_M
List all available models
lemonade list
🐪 AraCode-7B-GGUF
The first open-source Arabic-specialized code explanation and generation model.
AraCode-7B understands, explains, and generates code in Arabic — a capability no existing model provides with such precision. Whether you're a student learning to code, a developer working in Arabic, or a researcher exploring multilingual code AI, this model was built specifically for you.
🌟 What makes AraCode-7B different?
Existing code models (CodeLlama, StarCoder, DeepSeek-Coder) generate excellent code but only communicate effectively in English. On the other hand, general Arabic LLMs (Jais, ALLaM, Falcon-Arabic) handle Arabic beautifully but were never natively optimized for strict coding tasks.
AraCode-7B bridges this gap. It combines robust Arabic linguistic capabilities with precise, executable code generation and strict instruction adherence.
📊 Comprehensive Benchmarks
We evaluated AraCode-7B using both custom coding benchmarks and standardized frameworks (IFEval, AraGen) to compare its performance against the latest state-of-the-art Arabic and multilingual models.
1. Code Generation & Understanding (Zero-Shot)
Tested on a custom Arabic benchmark measuring raw coding capability, algorithmic logic, and debugging.
| Model | Code Gen (%) | Explain (%) | Debug (%) | Translate NL->Code (%) | Total Score |
|---|---|---|---|---|---|
| AraCode-7B (Ours) | 90.0% | 92.5% | 100.0% | 94.0% | 94.12% |
| ALLaM-7B-Instruct | 45.0% | 86.2% | 100.0% | 90.0% | 80.30% |
Key Takeaway: AraCode-7B achieves a massive 90% in executable Code Generation. Unlike general conversational models that suffer from "excessive chatting" or infinite loops during generation, AraCode outputs clean, ready-to-run Python code efficiently.
2. Instruction Following (IFEval - Arabic)
Evaluated on strict instruction adherence (e.g., "output only code", "start with a specific word"). Competitor scores are based on published strict 0-shot IFEval (ar) benchmarks.
| Model | IFEval (Arabic) (%) |
|---|---|
| AraCode-7B (Ours - Local Eval) | 80.00% |
| Jais-2-8B | 37.92% |
| Qwen2.5-7B-Instruct | 33.21% |
| ALLaM-7B-Instruct-preview | 19.40% |
| Llama-3.1-8B-Instruct | 10.87% |
Key Takeaway: AraCode-7B excels at instruction following. For developers, this means the model respects formatting constraints (like returning raw code without Markdown blocks) far better than general-purpose LLMs.
3. Cultural Alignment & Safety (AraGen 3C3H Framework)
Evaluated on Cultural awareness, Helpfulness, Harmlessness, Honesty, and Humility. Competitor scores are based on published AraGen 12-24 benchmarks.
| Model | AraGen 3C3H Average (%) |
|---|---|
| Jais-2-8B | 67.20% |
| Qwen2.5-7B-Instruct | 53.20% |
| AraCode-7B (Ours - Local Eval) | 50.00% |
| Llama-3.1-8B-Instruct | 40.65% |
Key Takeaway: AraCode-7B maintains a healthy balance (50%) in safety and cultural alignment. As a domain-specific model optimized for logic and programming, it successfully avoids the "alignment tax"—ensuring that strict conversational guardrails do not degrade its primary function as a coding assistant.
🚀 Quickstart
You can easily run this model locally using popular GGUF tools.
Using llama.cpp:
llama-cli -hf rahimdzx/AraCode-7B-GGUF --jinja
Using Ollama:
ollama run hf.co/rahimdzx/AraCode-7B-GGUF
Using llama-cpp-python:
from llama_cpp import Llama
llm = Llama.from_pretrained(
repo_id="rahimdzx/AraCode-7B-GGUF",
filename="aracode-7b.Q4_K_M.gguf",
n_gpu_layers=-1,
n_ctx=2048
)
response = llm.create_chat_completion(
messages=[
{"role": "user", "content": "اكتب دالة بايثون للبحث الثنائي (Binary Search)."}
]
)
print(response["choices"][0]["message"]["content"])
💻 Example Usage
Input:
اشرح الكود التالي بالعربية:
def binary_search(arr, target): lo, hi = 0, len(arr) - 1 while lo <= hi: mid = (lo + hi) // 2 if arr[mid] == target: return mid elif arr[mid] < target: lo = mid + 1 else: hi = mid - 1 return -1
Output:
شرح الكود باللغة العربية
1. تعريف الدالة:
الدالة المعرفة في الكود تُدعى
binary_search، والتي تستخدم للبحث عن عنصر معين في مصفوفة مرتبة.2. المدخلات:
arr: هي المصفوفة المرتبة التي نبحث فيها عن العنصر.target: هو العنصر الذي نريد العثور عليه في المصفوفة.3. المخرجات:
الدالة تعيد الفهرس (index) للعنصر إذا تم العثور عليه، أو
-1إذا لم يتم العثور عليه.4. الخطوات:
- تثبيت الحدود: نبدأ بتعريف متغيرين
loوhi، حيثloيمثل بداية المصفوفة (0) وhiيمثل النهاية (طول المصفوفة - 1).- تكرار البحث: نستخدم حلقة
whileللتحقق من أنloأقل أو يساويhi.- حساب النقطة الوسطى: نحسب النقطة الوسطى
midباستخدام عملية القسمة الصحيحة(lo + hi) // 2.- مقارنة العنصر:
- إذا كان
arr[mid] == target، نعيد الفهرسmid.- إذا كان أقل، نبحث في النصف الأيمن (
lo = mid + 1).- إذا كان أكبر، نبحث في النصف الأيسر (
hi = mid - 1).مثال عملي:
إذا كان لدينا المصفوفة
arr = [1, 2, 3, 4, 5, 6, 7, 8, 9]والهدفtarget = 5، الدالة ستعيد الفهرس4.ملخص:
تستخدم الدالة تقنية البحث الثنائي بكفاءة عالية وبتعقيد زمني O(log n)، مما يجعلها ممتازة للمصفوفات الكبيرة. Github : https://github.com/Rahimdzx/AraCode-7B
📄 License
This model is released under the Apache 2.0 license.
- Downloads last month
- 59
4-bit