๐Ÿช 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
520
GGUF
Model size
8B params
Architecture
qwen2
Hardware compatibility
Log In to add your hardware

4-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support