Instructions to use sh111111111111111/Qwen3-4B-Instruct-2507-BitClass2-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use sh111111111111111/Qwen3-4B-Instruct-2507-BitClass2-GGUF 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 sh111111111111111/Qwen3-4B-Instruct-2507-BitClass2-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf sh111111111111111/Qwen3-4B-Instruct-2507-BitClass2-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf sh111111111111111/Qwen3-4B-Instruct-2507-BitClass2-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf sh111111111111111/Qwen3-4B-Instruct-2507-BitClass2-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 sh111111111111111/Qwen3-4B-Instruct-2507-BitClass2-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf sh111111111111111/Qwen3-4B-Instruct-2507-BitClass2-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 sh111111111111111/Qwen3-4B-Instruct-2507-BitClass2-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf sh111111111111111/Qwen3-4B-Instruct-2507-BitClass2-GGUF:Q4_K_M
Use Docker
docker model run hf.co/sh111111111111111/Qwen3-4B-Instruct-2507-BitClass2-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use sh111111111111111/Qwen3-4B-Instruct-2507-BitClass2-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sh111111111111111/Qwen3-4B-Instruct-2507-BitClass2-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": "sh111111111111111/Qwen3-4B-Instruct-2507-BitClass2-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/sh111111111111111/Qwen3-4B-Instruct-2507-BitClass2-GGUF:Q4_K_M
- Ollama
How to use sh111111111111111/Qwen3-4B-Instruct-2507-BitClass2-GGUF with Ollama:
ollama run hf.co/sh111111111111111/Qwen3-4B-Instruct-2507-BitClass2-GGUF:Q4_K_M
- Unsloth Desktop
- Pi
How to use sh111111111111111/Qwen3-4B-Instruct-2507-BitClass2-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf sh111111111111111/Qwen3-4B-Instruct-2507-BitClass2-GGUF:Q4_K_M
Configure the model in 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": "sh111111111111111/Qwen3-4B-Instruct-2507-BitClass2-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use sh111111111111111/Qwen3-4B-Instruct-2507-BitClass2-GGUF with Docker Model Runner:
docker model run hf.co/sh111111111111111/Qwen3-4B-Instruct-2507-BitClass2-GGUF:Q4_K_M
- Lemonade
How to use sh111111111111111/Qwen3-4B-Instruct-2507-BitClass2-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull sh111111111111111/Qwen3-4B-Instruct-2507-BitClass2-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Qwen3-4B-Instruct-2507-BitClass2-GGUF-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use sh111111111111111/Qwen3-4B-Instruct-2507-BitClass2-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf sh111111111111111/Qwen3-4B-Instruct-2507-BitClass2-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 sh111111111111111/Qwen3-4B-Instruct-2507-BitClass2-GGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use sh111111111111111/Qwen3-4B-Instruct-2507-BitClass2-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf sh111111111111111/Qwen3-4B-Instruct-2507-BitClass2-GGUF: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 "sh111111111111111/Qwen3-4B-Instruct-2507-BitClass2-GGUF: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"
Run and chat with the model
lemonade run user.Qwen3-4B-Instruct-2507-BitClass2-GGUF-List all available models
lemonade listQwen3-4B-Instruct-2507 โ BitClass2 Mixed-Precision GGUF
Mixed-precision GGUF quantizations of Qwen3-4B-Instruct-2507 using Hessian-informed per-tensor bit allocation. Each tensor group receives the precision level that minimizes quality loss for its measured sensitivity โ more bits where they matter, fewer where they don't.
Available Quantizations
| File | BPW | Size | PPL โ | tok/s | Use Case |
|---|---|---|---|---|---|
Qwen3-4B-Instruct-2507-Q8_0.gguf |
8.5 | 4.28 GB | 2.651 | 11.4 | Near-lossless reference |
Qwen3-4B-Instruct-2507-Q6_K.gguf |
5.8 | 2.93 GB | 2.888 | 13.6 | High quality, moderate size |
Qwen3-4B-Instruct-2507-Q5_K_M.gguf |
5.2 | 2.60 GB | 2.971 | 14.3 | Balanced quality and size |
Qwen3-4B-Instruct-2507-Q4_K_M.gguf |
4.7 | 2.35 GB | 2.978 | 14.1 | Best quality-to-size ratio |
Qwen3-4B-Instruct-2507-Q3_K_S.gguf |
3.2 | 1.62 GB | 3.214 | 18.9 | Maximum compression |
Recommended: Q4_K_M for the best quality-to-size ratio (PPL 2.978 at just 2.35 GB). Q3_K_S for maximum compression. Q6_K for high quality.
How It Works
Standard quantization applies one precision level uniformly across all tensors. BitClass2 uses Hessian-based sensitivity analysis (H_diag = mean(Xยฒ) per layer) to identify which tensors lose the most quality when quantized, then solves an LP-optimal knapsack allocation: minimize ฮฃ(sensitivity ร quantization_error) subject to total size โค target. Sensitive tensors get higher precision, insensitive ones get lower precision, at the same total file size.
Within each suffix group, the fractional BPW planner further varies types per-layer using blended imatrix + Hessian scores, so late attention layers (most sensitive) get higher precision than middle layers (least sensitive).
Key Sensitivity Findings (Qwen3-4B)
- Late attention layers (29-35) are most sensitive โ blk.34 k/v score 1.0
- down_proj is the most sensitive MLP tensor โ projects back to residual stream
- gate_proj/up_proj are least sensitive โ safe to quantize aggressively
- K > V for attention weight sensitivity โ k_proj averages 0.66 vs v_proj 0.50
Usage
# Download
huggingface-cli download sh111111111111111/Qwen3-4B-Instruct-2507-BitClass2-GGUF \
Qwen3-4B-Instruct-2507-Q4_K_M.gguf --local-dir .
# Chat with llama.cpp
llama-cli -m Qwen3-4B-Instruct-2507-Q4_K_M.gguf -cnv
# Serve via API
llama-server -m Qwen3-4B-Instruct-2507-Q4_K_M.gguf --port 8080
# Ollama
ollama run hf.co/sh111111111111111/Qwen3-4B-Instruct-2507-BitClass2-GGUF:Qwen3-4B-Instruct-2507-Q4_K_M.gguf
Benchmark Details
All benchmarks run on NVIDIA GB10 ATOM (128GB unified memory, aarch64).
llama.cpp commit 406f4e3. PPL via llama-perplexity (2 chunks, 851 context).
tok/s via llama-bench (tg128, ngl=999).
Disclaimer
Independent project. Not affiliated with or endorsed by Qwen, Unsloth, ByteShape, Bartowski, or llama.cpp.
License
Apache 2.0, inherited from Qwen3-4B-Instruct-2507.
- Downloads last month
- 106
3-bit
4-bit
5-bit
6-bit
8-bit
Model tree for sh111111111111111/Qwen3-4B-Instruct-2507-BitClass2-GGUF
Base model
Qwen/Qwen3-4B-Instruct-2507
Pull the model
# Download Lemonade from https://lemonade-server.ai/lemonade pull sh111111111111111/Qwen3-4B-Instruct-2507-BitClass2-GGUF: