Instructions to use MESHIVEAI/Qwen-3.8-27B-Q4_K_M-Imatrix 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 MESHIVEAI/Qwen-3.8-27B-Q4_K_M-Imatrix 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 MESHIVEAI/Qwen-3.8-27B-Q4_K_M-Imatrix:Q4_K_M # Run inference directly in the terminal: llama cli -hf MESHIVEAI/Qwen-3.8-27B-Q4_K_M-Imatrix:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf MESHIVEAI/Qwen-3.8-27B-Q4_K_M-Imatrix:Q4_K_M # Run inference directly in the terminal: llama cli -hf MESHIVEAI/Qwen-3.8-27B-Q4_K_M-Imatrix: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 MESHIVEAI/Qwen-3.8-27B-Q4_K_M-Imatrix:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf MESHIVEAI/Qwen-3.8-27B-Q4_K_M-Imatrix: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 MESHIVEAI/Qwen-3.8-27B-Q4_K_M-Imatrix:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf MESHIVEAI/Qwen-3.8-27B-Q4_K_M-Imatrix:Q4_K_M
Use Docker
docker model run hf.co/MESHIVEAI/Qwen-3.8-27B-Q4_K_M-Imatrix:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use MESHIVEAI/Qwen-3.8-27B-Q4_K_M-Imatrix with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MESHIVEAI/Qwen-3.8-27B-Q4_K_M-Imatrix" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MESHIVEAI/Qwen-3.8-27B-Q4_K_M-Imatrix", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/MESHIVEAI/Qwen-3.8-27B-Q4_K_M-Imatrix:Q4_K_M
- Ollama
How to use MESHIVEAI/Qwen-3.8-27B-Q4_K_M-Imatrix with Ollama:
ollama run hf.co/MESHIVEAI/Qwen-3.8-27B-Q4_K_M-Imatrix:Q4_K_M
- Unsloth Desktop
- Pi
How to use MESHIVEAI/Qwen-3.8-27B-Q4_K_M-Imatrix with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf MESHIVEAI/Qwen-3.8-27B-Q4_K_M-Imatrix: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": "MESHIVEAI/Qwen-3.8-27B-Q4_K_M-Imatrix:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use MESHIVEAI/Qwen-3.8-27B-Q4_K_M-Imatrix with Docker Model Runner:
docker model run hf.co/MESHIVEAI/Qwen-3.8-27B-Q4_K_M-Imatrix:Q4_K_M
- Lemonade
How to use MESHIVEAI/Qwen-3.8-27B-Q4_K_M-Imatrix with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull MESHIVEAI/Qwen-3.8-27B-Q4_K_M-Imatrix:Q4_K_M
Run and chat with the model
lemonade run user.Qwen-3.8-27B-Q4_K_M-Imatrix-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use MESHIVEAI/Qwen-3.8-27B-Q4_K_M-Imatrix with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf MESHIVEAI/Qwen-3.8-27B-Q4_K_M-Imatrix: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 MESHIVEAI/Qwen-3.8-27B-Q4_K_M-Imatrix:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use MESHIVEAI/Qwen-3.8-27B-Q4_K_M-Imatrix with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf MESHIVEAI/Qwen-3.8-27B-Q4_K_M-Imatrix: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 "MESHIVEAI/Qwen-3.8-27B-Q4_K_M-Imatrix: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"
Qwen-3.8-27B — Q4_K_M GGUF (imatrix)
A Q4_K_M GGUF quantization of Qwen/Qwen3.8-27B, built with a custom importance matrix.
Every number on this card was measured, not estimated. The measurement setup is documented at the bottom so you can reproduce it.
| File size | 15.65 GiB (16,810,714,624 bytes) |
| Parameters | 27.32 B |
| Architecture | qwen35 hybrid — 65 blocks (48 Gated DeltaNet + 17 full attention) |
| Vocab | 248,320 |
| Trained context | 262,144 (see Known issues) |
| Weight types | Q4_K ×439, Q6_K ×67, F32 ×360 |
Why imatrix
An importance matrix records which weights actually matter for the model's predictions, so the 4-bit quantizer spends its limited precision where it counts. The question is whether it measurably helps. For this model, it does.
Both models below were quantized from the same F16 GGUF with the same Q4_K_M recipe. Their tensor data is byte-for-byte the same size — the only difference is which values the quantizer picked. Measured against the F16 baseline on the full Wikitext-2 test set (296,960 tokens, 580 chunks):
| Metric | This model (imatrix) | Same quant, no imatrix | Improvement |
|---|---|---|---|
| Mean KL divergence ↓ | 0.017486 ± 0.000201 | 0.025196 ± 0.000291 | −31% |
| Top-token agreement ↑ | 94.18% ± 0.06 | 92.97% ± 0.07 | +1.21 pp |
| RMS Δp ↓ | 3.583% ± 0.034 | 4.305% ± 0.040 | −17% |
| Mean Δp ↓ | −0.124% ± 0.009 | −0.195% ± 0.011 | −36% |
| Perplexity | 6.9619 | 6.9755 | |
| ΔPPL vs F16 ↓ | +0.0092 ± 0.0041 | +0.0228 ± 0.0050 | −60% |
F16 reference: PPL 6.9527 ± 0.0450.
KL divergence is the metric to watch — it measures how far the quantized model's whole output distribution drifts from F16, and unlike perplexity it doesn't let errors cancel out. The gap here is roughly 22σ, so it is not noise.
For context, llama.cpp's own Q4_K_M scoreboard shows a ~10% KLD improvement from an imatrix built on 10M tokens. This one gets 31% from 326k tokens, which is what a 27B model's weight-importance structure being highly non-uniform looks like.
Out-of-domain check: Korean
The imatrix was calibrated on English text, so the table above is a best case. To
see how far the benefit carries, the same three models were scored on Korean
Wikipedia (wikimedia/wikipedia, 20231101.ko, 1,123,328 tokens):
| F16 | This model | No imatrix | |
|---|---|---|---|
| Perplexity | 6.8782 | 6.9485 | 6.9596 |
| Degradation vs F16 | — | +1.02% | +1.18% |
Two things to take from this. The imatrix version is still ahead, by roughly 14% less degradation. And both quantizations lose noticeably more on Korean than on English — around 1% versus 0.1-0.3% — so an English-calibrated imatrix narrows the gap on out-of-domain text without closing it.
This run measured perplexity only, without the paired per-token statistics that the KL-divergence mode produces. The direction is consistent and matches the English result, but the Korean margin should be read as indicative rather than as an established effect size.
Speed
Measured on a single RTX PRO 6000 Blackwell Workstation Edition (96 GB), CUDA 13.0,
llama.cpp build d077b4c21, all layers offloaded.
| Context depth | Prefill (pp4096) | Generation (tg128) | tg retained |
|---|---|---|---|
| 0 | 4,019 t/s | 79.85 t/s | 100% |
| 16,384 | 3,474 t/s | 73.83 t/s | 92% |
| 65,536 | 2,276 t/s | 64.37 t/s | 81% |
| 131,072 | 1,571 t/s | 54.85 t/s | 69% |
Generation holds 69% of its speed at 128k context. That is unusually flat for a 27B model, and it comes from the hybrid architecture: only 17 of 65 layers keep a growing KV cache, while the other 48 are constant-state Gated DeltaNet layers.
Generation is memory-bandwidth bound, running at roughly 1.29 TB/s — about 72% of the card's theoretical peak.
Hardware requirements
The weights alone are 15.65 GiB, so 16 GB is not enough. Budget for the KV cache on top:
| Context | Approx. total VRAM | Fits on |
|---|---|---|
| 8k | ~18 GB | 24 GB card |
| 32k | ~20 GB | 24 GB card |
| 64k | ~23 GB | 24 GB card |
| 128k | ~27 GB | 32 GB card |
KV figures are computed from the model config (17 attention layers × 4 KV heads ×
512 head dim, F16) and will vary a little by runtime. Use --cache-type-k q8_0 --cache-type-v q8_0 to roughly halve them, or offload fewer layers with -ngl to
run on a smaller card at reduced speed. CPU-only works with 32 GB of system RAM.
Usage
llama.cpp
Needs a build with qwen35 hybrid support — use a recent release. Earlier builds
will fail to load with a tensor or architecture error.
llama-cli -m Qwen-3.8-27B-Q4_K_M-Imatrix.gguf -ngl 999 -c 32768 \
-p "Explain the concept of quantum computing in simple terms."
As an OpenAI-compatible server:
llama-server -m Qwen-3.8-27B-Q4_K_M-Imatrix.gguf -ngl 999 -c 32768 --host 0.0.0.0 --port 8080
Ollama
printf 'FROM ./Qwen-3.8-27B-Q4_K_M-Imatrix.gguf\n' > Modelfile
ollama create qwen-3.8-27b-imatrix -f Modelfile
ollama run qwen-3.8-27b-imatrix
Ollama and LM Studio bundle their own llama.cpp, so update to a recent version before reporting a load failure.
Chat template
Do not set a chat template manually, and do not use ChatML. This model ships a Qwen3.5-specific template that is already embedded in the GGUF; llama.cpp, Ollama, and LM Studio apply it automatically. Overriding it with ChatML degrades output quality and breaks tool calling.
Known issues
Context above ~130k is currently broken upstream. The model advertises 262,144
context, but on qwen35 hybrid models llama.cpp emits EOS as the first generated
token once the prompt exceeds roughly 130k positions — prefill completes normally,
then generation stops immediately. This affects the CUDA and CPU backends alike and
is tracked at ggml-org/llama.cpp#27756.
It is an inference-engine bug, not a quantization artifact; the same failure occurs
on unquantized weights. Keep prompts under 128k until it is fixed.
Use the CUDA or Metal backends. Two other open upstream bugs affect this architecture: Vulkan produces garbage output at batch size 512 (#27237) and the HIP backend silently corrupts inference on gfx1151 (#27556).
Text only. The base model is multimodal, but this GGUF contains the text tower
only — there is no mmproj file, so image and video input will not work.
Quantization method
Base model Qwen/Qwen3.8-27B → F16 GGUF via convert_hf_to_gguf.py
Quantizer llama.cpp llama-quantize, Q4_K_M
Imatrix Wikitext-2 (train), 637 chunks (~326k tokens), computed over F16
Hardware NVIDIA RTX PRO 6000 Blackwell Workstation Edition (96 GB)
The imatrix metadata is embedded in the GGUF and can be inspected with any GGUF
reader — look for quantize.imatrix.entries_count (496) and
quantize.imatrix.chunks_count (637).
Reproducing the evaluation
# 1. F16 reference logits
llama-perplexity -m base-f16.gguf -f wiki.test.raw -c 512 -b 512 -ngl 999 \
--kl-divergence-base ref.kld
# 2. Score this model against them
llama-perplexity -m Qwen-3.8-27B-Q4_K_M-Imatrix.gguf -f wiki.test.raw \
-c 512 -b 512 -ngl 999 --kl-divergence-base ref.kld --kl-divergence
ref.kld is about 69 GiB for this vocabulary size — roughly 250 KB per token of
corpus. To build the no-imatrix control, run llama-quantize base-f16.gguf control.gguf Q4_K_M and score it the same way.
Caveats
The imatrix was calibrated on Wikitext-2 train and evaluated on Wikitext-2 test. The two splits are disjoint, but they share a domain, so the 31% figure is a best case for English encyclopedic prose. The Korean check above suggests the margin narrows to roughly 14% out of domain; expect something in that range for code, dialogue, or other languages.
10 of the 506 quantized tensors had no imatrix coverage and fell back to standard quantization.
Credits
Quantized by meshive. Base model by the Qwen team, Apache-2.0.
Evaluation methodology follows llama.cpp's perplexity tool.
- Downloads last month
- 18
4-bit
Model tree for MESHIVEAI/Qwen-3.8-27B-Q4_K_M-Imatrix
Base model
Qwen/Qwen3.8-27B