Qwen 2.5 Coder 1.5B

Apache 2.0

Alibaba · 1.5B · كثيف

نموذج برمجة فائق الخفة. تعرّف على ما إذا كان كرت شاشتك أو جهاز الماك قادرًا على تشغيل Qwen 2.5 Coder 1.5B محليًا — 1 جيجابايت كحد أدنى، و2 جيجابايت موصى بها.

كيف تستخدم Qwen 2.5 Coder 1.5B في Transformers

حمّل Qwen 2.5 Coder 1.5B في بايثون عبر مكتبة Transformers من HuggingFace. هذه الأوزان الكاملة غير المكمَّمة، فتحتاج ذاكرة أكبر من ملفات GGUF.

عبر pipeline — الطريقة الأسهل

pip install -U transformers
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("text-generation", model="Qwen/Qwen2.5-Coder-1.5B-Instruct")
messages = [
    {"role": "user", "content": "Who are you?"},
]
pipe(messages)

تحميل النموذج مباشرة

pip install -U transformers
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-Coder-1.5B-Instruct")
model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-Coder-1.5B-Instruct", 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]:]))

التوثيق الرسمي: Transformers

كيف تستخدم Qwen 2.5 Coder 1.5B في llama.cpp

يحمّل llama.cpp ملف Qwen 2.5 Coder 1.5B من HuggingFace مباشرة ويشغّله، إمّا خادمًا متوافقًا مع OpenAI بواجهة ويب أو في الطرفية. اختر مستوى الـ Quantization من القائمة، وتتحدّث الأوامر معه.

ملف GGUF من Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF

التثبيت على macOS وLinux

curl -LsSf https://llama.app/install.sh | sh
# Start a local OpenAI-compatible server with a web UI:
llama serve -hf Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF:Q4_K_M
# Run inference directly in the terminal:
llama cli -hf Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF:Q4_K_M

التثبيت عبر WinGet على Windows

winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama serve -hf Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF:Q4_K_M
# Run inference directly in the terminal:
llama cli -hf Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF:Q4_K_M

نسخة جاهزة من صفحة الإصدارات

# 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 Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF:Q4_K_M
# Run inference directly in the terminal:
./llama-cli -hf Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF:Q4_K_M

البناء من الكود المصدري

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 Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF:Q4_K_M
# Run inference directly in the terminal:
./build/bin/llama-cli -hf Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF:Q4_K_M

عبر Docker

docker model run hf.co/Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF:Q4_K_M

التوثيق الرسمي: llama.cpp

كيف تستخدم Qwen 2.5 Coder 1.5B في Ollama

ينزّل Ollama النموذج ويفتح محادثة محلية بأمر واحد. اختر مستوى الـ Quantization من القائمة، وتتحدّث الأوامر معه.

ملف GGUF من Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF

من مكتبة Ollama الرسمية

ollama run qwen2.5-coder:1.5b

من ملف GGUF على HuggingFace

ollama run hf.co/Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF:Q4_K_M

التوثيق الرسمي: Ollama

كيف تستخدم Qwen 2.5 Coder 1.5B في Pi

Pi وكيل برمجة يعمل في الطرفية. شغّل Qwen 2.5 Coder 1.5B على خادم llama.cpp محلي ثم وجّه Pi إليه. اختر مستوى الـ Quantization من القائمة، وتتحدّث الأوامر معه.

ملف GGUF من Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF

شغّل خادم llama.cpp

# Install llama.cpp:
brew install llama.cpp
# Start a local OpenAI-compatible server:
llama serve -hf Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF:Q4_K_M

أضف النموذج إلى Pi

# Install Pi:
npm install -g @earendil-works/pi-coding-agent
# Add to ~/.pi/agent/models.json:
{
  "providers": {
    "llama-cpp": {
      "baseUrl": "http://localhost:8080/v1",
      "api": "openai-completions",
      "apiKey": "none",
      "models": [
        {
          "id": "Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF:Q4_K_M"
        }
      ]
    }
  }
}

شغّل Pi

# Start Pi in your project directory:
pi

التوثيق الرسمي: Pi

كيف تستخدم Qwen 2.5 Coder 1.5B في node-llama-cpp

شغّل Qwen 2.5 Coder 1.5B من Node.js بلا تثبيت مسبق. اختر مستوى الـ Quantization من القائمة، وتتحدّث الأوامر معه.

ملف GGUF من Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF

محادثة مع النموذج

npx -y node-llama-cpp chat hf:Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF:Q4_K_M

قدّر توافق النموذج مع جهازك

npx -y node-llama-cpp inspect estimate hf:Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF:Q4_K_M

التوثيق الرسمي: node-llama-cpp

كيف تستخدم Qwen 2.5 Coder 1.5B في Docker Model Runner

يشغّل Docker Desktop النموذج محليًا ويتيحه عبر واجهة متوافقة مع OpenAI. اختر مستوى الـ Quantization من القائمة، وتتحدّث الأوامر معه.

ملف GGUF من Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF

شغّل النموذج

docker model run hf.co/Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF:Q4_K_M

التوثيق الرسمي: Docker Model Runner

كيف تستخدم Qwen 2.5 Coder 1.5B في LocalAI

LocalAI خادم محلي متوافق مع OpenAI. استبدل {{GGUF_FILE}} باسم ملف GGUF الذي تريده من المستودع Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF.

التثبيت من ملف تنفيذي

curl https://localai.io/install.sh | sh
# Load and run the model:
local-ai run huggingface://Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF/{{GGUF_FILE}}

عبر صور Docker

# Pull the image:
docker pull localai/localai:latest-cpu
# Load and run the model:
docker run -p 8080:8080 --name localai -v $PWD/models:/build/models localai/localai:latest-cpu huggingface://Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF/{{GGUF_FILE}}

التوثيق الرسمي: LocalAI

كيف تستخدم Qwen 2.5 Coder 1.5B في Lemonade

Lemonade خادم محلي من AMD يعمل على المعالجات وكروت الشاشة. اختر مستوى الـ Quantization من القائمة، وتتحدّث الأوامر معه.

ملف GGUF من Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF

نزّل النموذج

# Download Lemonade from https://lemonade-server.ai/
lemonade pull Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF:Q4_K_M

شغّل النموذج وحاوره

lemonade run user.Qwen2.5-Coder-1.5B-Instruct-GGUF-Q4_K_M

اعرض كل النماذج المتاحة

lemonade list

التوثيق الرسمي: Lemonade

كيف تستخدم Qwen 2.5 Coder 1.5B في Hermes Agent

وكيل Hermes من Nous Research. شغّل Qwen 2.5 Coder 1.5B على خادم llama.cpp محلي ثم وجّه Hermes إليه. اختر مستوى الـ Quantization من القائمة، وتتحدّث الأوامر معه.

ملف GGUF من Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF

شغّل خادم llama.cpp

# Install llama.cpp:
brew install llama.cpp
# Start a local OpenAI-compatible server:
llama serve -hf Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF:Q4_K_M

اضبط 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 Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF:Q4_K_M

شغّل Hermes

hermes

التوثيق الرسمي: Hermes Agent

كيف تستخدم Qwen 2.5 Coder 1.5B في OpenClaw

OpenClaw وكيل مفتوح المصدر يعمل على جهازك. شغّل Qwen 2.5 Coder 1.5B على خادم llama.cpp محلي ثم سجّله في OpenClaw. اختر مستوى الـ Quantization من القائمة، وتتحدّث الأوامر معه.

ملف GGUF من Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF

شغّل خادم llama.cpp

# Install llama.cpp:
brew install llama.cpp
# Start a local OpenAI-compatible server:
llama serve -hf Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF:Q4_K_M

اضبط OpenClaw

# Install OpenClaw:
npm install -g openclaw@latest
# Register the local server and set it as the default model:
openclaw onboard --non-interactive --mode local \
  --auth-choice custom-api-key \
  --custom-base-url http://127.0.0.1:8080/v1 \
  --custom-model-id "Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF:Q4_K_M" \
  --custom-provider-id llama-cpp \
  --custom-compatibility openai \
  --custom-text-input \
  --accept-risk \
  --skip-health

شغّل OpenClaw

openclaw agent --local --agent main --message "Hello from Hugging Face"

التوثيق الرسمي: OpenClaw

أوامر التشغيلHuggingFaceOllama
2024-11سياق 32K

مستويات الـ Quantization

Quantizationالبتاتالذاكرةالجودةالحالة
Q2_K21GBمنخفضة—
Q3_K_M31.2GBمتوسطة—
Q4_K_M41.3GBجيدة—
Q5_K_M51.5GBجيدة—
Q6_K61.7GBممتازة—
Q8_082GBممتازة—
F16163.6GBبلا فقد—

الأرقام تشمل الأوزان وذاكرة KV عند طول سياق 2K توكن. غيّر طول السياق من لوحة جهازك لترى أثره على الذاكرة والسرعة.

التطبيقات

شغّل Qwen 2.5 Coder 1.5B داخل أدوات البرمجة التي تعمل بالذكاء الاصطناعي — يشغّل الأمر خادم Ollama على جهازك، يحمّل النموذج، ثم يفتح الأداة موصولة به.

  • Claude Code

    وكيل البرمجة من Anthropic، يعمل في الطرفية وداخل المحرّر

    ollama launch claude --model qwen2.5-coder:1.5b
  • OpenCode

    وكيل برمجة مفتوح المصدر يعمل في الطرفية داخل مستودعك

    ollama launch opencode --model qwen2.5-coder:1.5b
  • Codex

    وكيل البرمجة من OpenAI في سطر الأوامر

    ollama launch codex --model qwen2.5-coder:1.5b
  • Droid

    وكيل البرمجة من Factory، للمهام الطويلة عبر عدّة ملفات

    ollama launch droid --model qwen2.5-coder:1.5b
  • Hermes Agent

    وكيل برمجة مفتوح من Nous Research، بذاكرة تمتد عبر الجلسات

    ollama launch hermes --model qwen2.5-coder:1.5b
  • OpenClaw

    وكيل مفتوح المصدر يشغّل المهام على جهازك بلا خدمة سحابية

    ollama launch openclaw --model qwen2.5-coder:1.5b

تحتاج Ollama والأداة نفسها مثبَّتين. إن لم تكن الأداة مثبّتة، يرشدك الأمر إلى طريقة تثبيتها. اكتب ollama launch وحده لاختيار الأداة من قائمة.

عن هذا النموذج

الوصف الرسمي كما نشرته الجهة المطوِّرة، بلغته الأصلية.

Qwen 2.5 Coder series of models are now updated in 6 sizes: 0.5B, 1.5B, 3B, 7B, 14B and 32B.

There are significant improvements in code generation, code reasoning and code fixing. The 32B model has competitive performance with OpenAI’s GPT-4o.

32B: ollama run qwen2.5-coder:32b

14B: ollama run qwen2.5-coder:14b

7B: ollama run qwen2.5-coder:7b

3B: ollama run qwen2.5-coder:3b

1.5B: ollama run qwen2.5-coder:1.5b

0.5B: ollama run qwen2.5-coder:0.5b

Code capabilities reaching state of the art for open-source models

Comparison benchmarks

Code Generation: Qwen2.5 Coder 32B Instruct, as the flagship model of this open-source release, has achieved the best performance among open-source models on multiple popular code generation benchmarks (EvalPlus, LiveCodeBench, BigCodeBench), and has competitive performance with GPT-4o.

Code Repair: Code repair is an important programming skill. Qwen2.5 Coder 32B Instruct can help users fix errors in their code, making programming more efficient. Aider is a popular benchmark for code repair, and Qwen2.5 Coder 32B Instruct scored 73.7, performing comparably to GPT-4o on Aider.

Code Reasoning: Code reasoning refers to the model’s ability to learn the process of code execution and accurately predict the model’s inputs and outputs. The recently released Qwen2.5 Coder 7B Instruct has already shown impressive performance in code reasoning, and this 32B model takes it a step further.

Benchmarks

Multiple programming languages

An intelligent programming assistant should be familiar with all programming languages. Qwen 2.5 Coder 32B performs excellent across more than 40 programming languages, scoring 65.9 on McEval, with impressive performances in languages like Haskell and Racket. The Qwen team used their own unique data cleaning and balancing during the pre-training phase.

McEval Performance

Additionally, the multi-language code repair capabilities of Qwen 2.5 Coder 32B Instruct remain impressive, aiding users in understanding and modifying programming languages they are familiar with, significantly reducing the learning cost of unfamiliar languages. Similar to McEval, MdEval is a multi-language code repair benchmark, where Qwen 2.5 Coder 32B Instruct scored 75.2, ranking first among all open-source models.

MdEval Performance

Human Preference

To evaluate the alignment performance of Qwen 2.5 Coder 32B Instruct with human preferences, we constructed an internal annotated code preference evaluation benchmark called Code Arena (similar to Arena Hard). We used GPT-4o as the evaluation model for preference alignment, employing an ‘A vs. B win’ evaluation method, which measures the percentage of instances in the test set where model A’s score exceeds model B’s. The results below demonstrate the advantages of Qwen 2.5 Coder 32B Instruct in preference alignment.

human preference

Comprehensive model sizes to fit your device

Model sizes

References

Blog Post

HuggingFace

أسئلة شائعة عن تشغيل Qwen 2.5 Coder 1.5B محليًا

هل أستطيع تشغيل Qwen 2.5 Coder 1.5B على جهازي؟
يحتاج Qwen 2.5 Coder 1.5B إلى 1 جيجابايت من الذاكرة كحد أدنى، والموصى به 2 جيجابايت. يكفي أن تفتح هذه الصفحة ليُقيَّم النموذج تلقائيًا أمام كرت شاشتك أو جهاز الماك، ثم تشغّله عبر Ollama أو LM Studio أو llama.cpp.
كم يحتاج Qwen 2.5 Coder 1.5B من الـ VRAM؟
بتكميم Q4_K_M يستهلك Qwen 2.5 Coder 1.5B نحو 1.3 جيجابايت من ذاكرة الكرت. أما المستويات الأعلى فتحتاج ذاكرة أكبر، والأدنى تناسب الكروت المحدودة مقابل تنازل في الجودة.