Instructions to use ShahzebKhoso/Qwen2.5-Coder-7B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use ShahzebKhoso/Qwen2.5-Coder-7B-Instruct with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="ShahzebKhoso/Qwen2.5-Coder-7B-Instruct", filename="Qwen2.5-Coder-7B-Instruct-FP16.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use ShahzebKhoso/Qwen2.5-Coder-7B-Instruct with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf ShahzebKhoso/Qwen2.5-Coder-7B-Instruct:Q4_K_M # Run inference directly in the terminal: llama cli -hf ShahzebKhoso/Qwen2.5-Coder-7B-Instruct:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf ShahzebKhoso/Qwen2.5-Coder-7B-Instruct:Q4_K_M # Run inference directly in the terminal: llama cli -hf ShahzebKhoso/Qwen2.5-Coder-7B-Instruct: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 ShahzebKhoso/Qwen2.5-Coder-7B-Instruct:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf ShahzebKhoso/Qwen2.5-Coder-7B-Instruct: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 ShahzebKhoso/Qwen2.5-Coder-7B-Instruct:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf ShahzebKhoso/Qwen2.5-Coder-7B-Instruct:Q4_K_M
Use Docker
docker model run hf.co/ShahzebKhoso/Qwen2.5-Coder-7B-Instruct:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use ShahzebKhoso/Qwen2.5-Coder-7B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ShahzebKhoso/Qwen2.5-Coder-7B-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ShahzebKhoso/Qwen2.5-Coder-7B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ShahzebKhoso/Qwen2.5-Coder-7B-Instruct:Q4_K_M
- Ollama
How to use ShahzebKhoso/Qwen2.5-Coder-7B-Instruct with Ollama:
ollama run hf.co/ShahzebKhoso/Qwen2.5-Coder-7B-Instruct:Q4_K_M
- Unsloth Studio
How to use ShahzebKhoso/Qwen2.5-Coder-7B-Instruct 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 ShahzebKhoso/Qwen2.5-Coder-7B-Instruct 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 ShahzebKhoso/Qwen2.5-Coder-7B-Instruct to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for ShahzebKhoso/Qwen2.5-Coder-7B-Instruct to start chatting
- Pi
How to use ShahzebKhoso/Qwen2.5-Coder-7B-Instruct with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ShahzebKhoso/Qwen2.5-Coder-7B-Instruct: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": "ShahzebKhoso/Qwen2.5-Coder-7B-Instruct:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use ShahzebKhoso/Qwen2.5-Coder-7B-Instruct with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ShahzebKhoso/Qwen2.5-Coder-7B-Instruct: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 ShahzebKhoso/Qwen2.5-Coder-7B-Instruct:Q4_K_M
Run Hermes
hermes
- Atomic Chat new
- OpenClaw new
How to use ShahzebKhoso/Qwen2.5-Coder-7B-Instruct with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ShahzebKhoso/Qwen2.5-Coder-7B-Instruct:Q4_K_M
Configure 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 "ShahzebKhoso/Qwen2.5-Coder-7B-Instruct:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- Docker Model Runner
How to use ShahzebKhoso/Qwen2.5-Coder-7B-Instruct with Docker Model Runner:
docker model run hf.co/ShahzebKhoso/Qwen2.5-Coder-7B-Instruct:Q4_K_M
- Lemonade
How to use ShahzebKhoso/Qwen2.5-Coder-7B-Instruct with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull ShahzebKhoso/Qwen2.5-Coder-7B-Instruct:Q4_K_M
Run and chat with the model
lemonade run user.Qwen2.5-Coder-7B-Instruct-Q4_K_M
List all available models
lemonade list
llm.create_chat_completion(
messages = [
{
"role": "user",
"content": "What is the capital of France?"
}
]
)Qwen2.5-Coder-7B-Instruct - GGUF Quantized Versions
This repository provides GGUF quantized versions of Qwen/Qwen2.5-Coder-7B-Instruct, converted with llama.cpp.
The purpose of this repository is to provide fast, easy-to-use local inference files for llama.cpp, Ollama, LM Studio, Jan, Open WebUI, and llama-cpp-python users.
Model Details
- Base model:
Qwen/Qwen2.5-Coder-7B-Instruct - Architecture: Qwen 2
- Format: GGUF
- Source license:
apache-2.0 - Conversion tool:
convert_hf_to_gguf.pyfrom llama.cpp - Quantization tool:
llama-quantize - Recommended file:
Qwen2.5-Coder-7B-Instruct-Q4_K_M.gguf
Quantized Files
| Quant | Filename | Size | SHA256 | Notes |
|---|---|---|---|---|
| FP16 | Qwen2.5-Coder-7B-Instruct-FP16.gguf |
~14.19 GiB | 274c0eb05fe4... |
Full precision converted GGUF baseline |
| Q2_K | Qwen2.5-Coder-7B-Instruct-Q2_K.gguf |
~2.81 GiB | 3200d17f49c6... |
Smallest, lowest quality |
| Q3_K_M | Qwen2.5-Coder-7B-Instruct-Q3_K_M.gguf |
~3.55 GiB | 30be23c2bc76... |
Small balanced version |
| Q4_0 | Qwen2.5-Coder-7B-Instruct-Q4_0.gguf |
~4.13 GiB | 339fbe41f5d4... |
Simple 4-bit quantization |
| Q4_K_M | Qwen2.5-Coder-7B-Instruct-Q4_K_M.gguf |
~4.36 GiB | 46caa6175bbe... |
Recommended default for most users |
| Q5_K_M | Qwen2.5-Coder-7B-Instruct-Q5_K_M.gguf |
~5.07 GiB | 38d6bd18220d... |
Better quality with moderate size |
| Q6_K | Qwen2.5-Coder-7B-Instruct-Q6_K.gguf |
~5.82 GiB | 86b8e1701365... |
High quality |
| Q8_0 | Qwen2.5-Coder-7B-Instruct-Q8_0.gguf |
~7.54 GiB | d4cdb65b1880... |
Near FP16 quality |
Validation
Each file was tested with llama-cli for basic load + generation.
| Quant | Filename | Status |
|---|---|---|
| FP16 | Qwen2.5-Coder-7B-Instruct-FP16.gguf |
✅ passed |
| Q2_K | Qwen2.5-Coder-7B-Instruct-Q2_K.gguf |
✅ passed |
| Q3_K_M | Qwen2.5-Coder-7B-Instruct-Q3_K_M.gguf |
✅ passed |
| Q4_0 | Qwen2.5-Coder-7B-Instruct-Q4_0.gguf |
✅ passed |
| Q4_K_M | Qwen2.5-Coder-7B-Instruct-Q4_K_M.gguf |
✅ passed |
| Q5_K_M | Qwen2.5-Coder-7B-Instruct-Q5_K_M.gguf |
✅ passed |
| Q6_K | Qwen2.5-Coder-7B-Instruct-Q6_K.gguf |
✅ passed |
| Q8_0 | Qwen2.5-Coder-7B-Instruct-Q8_0.gguf |
✅ passed |
Usage
llama.cpp
llama-cli -m Qwen2.5-Coder-7B-Instruct-Q4_K_M.gguf -p "Hello! Introduce yourself briefly."
Older builds may use:
./main -m Qwen2.5-Coder-7B-Instruct-Q4_K_M.gguf -p "Hello! Introduce yourself briefly."
llama.cpp directly from Hugging Face
llama-cli -hf ShahzebKhoso/Qwen2.5-Coder-7B-Instruct:Q4_K_M -p "Hello! Introduce yourself briefly."
llama-cpp-python
from huggingface_hub import hf_hub_download
from llama_cpp import Llama
model_path = hf_hub_download(
repo_id="ShahzebKhoso/Qwen2.5-Coder-7B-Instruct",
filename="Qwen2.5-Coder-7B-Instruct-Q4_K_M.gguf",
)
llm = Llama(model_path=model_path)
out = llm.create_chat_completion(
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello! Introduce yourself briefly."},
],
max_tokens=128,
)
print(out["choices"][0]["message"]["content"])
Which file should I use?
- Use
Q4_K_Mfor the best default balance. - Use
Q5_K_Mfor better quality. - Use
Q8_0if you want near-original quality and have more memory. - Use
Q2_KorQ3_K_Monly when memory is very limited.
Provenance
This repository is a quantized derivative of:
Qwen/Qwen2.5-Coder-7B-Instruct
Base model metadata:
revision: c03e6d358207e414f1eca0bb1891e29f1db0e242
pipeline_tag: text-generation
tags: transformers, safetensors, qwen2, text-generation, code, codeqwen, chat, qwen, qwen-coder, conversational, en, arxiv:2409.12186, arxiv:2309.00071, arxiv:2407.10671, base_model:Qwen/Qwen2.5-Coder-7B, base_model:finetune:Qwen/Qwen2.5-Coder-7B, license:apache-2.0, text-generation-inference, endpoints_compatible, deploy:azure
- Downloads last month
- 146
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="ShahzebKhoso/Qwen2.5-Coder-7B-Instruct", filename="", )