Instructions to use LeoHyperlink/Qwen3.8-27B-Pi-W4A8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LeoHyperlink/Qwen3.8-27B-Pi-W4A8 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LeoHyperlink/Qwen3.8-27B-Pi-W4A8") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("LeoHyperlink/Qwen3.8-27B-Pi-W4A8") model = AutoModelForMultimodalLM.from_pretrained("LeoHyperlink/Qwen3.8-27B-Pi-W4A8", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use LeoHyperlink/Qwen3.8-27B-Pi-W4A8 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LeoHyperlink/Qwen3.8-27B-Pi-W4A8" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LeoHyperlink/Qwen3.8-27B-Pi-W4A8", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/LeoHyperlink/Qwen3.8-27B-Pi-W4A8
- SGLang
How to use LeoHyperlink/Qwen3.8-27B-Pi-W4A8 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "LeoHyperlink/Qwen3.8-27B-Pi-W4A8" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LeoHyperlink/Qwen3.8-27B-Pi-W4A8", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "LeoHyperlink/Qwen3.8-27B-Pi-W4A8" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LeoHyperlink/Qwen3.8-27B-Pi-W4A8", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use LeoHyperlink/Qwen3.8-27B-Pi-W4A8 with Docker Model Runner:
docker model run hf.co/LeoHyperlink/Qwen3.8-27B-Pi-W4A8
Qwen3.8-27B-Pi-W4A8
W4A8 (int4 weights, dynamic int8 activations, group 128) compressed-tensors quantization of bytkim/Qwen3.8-27B-pi for fast text serving on Intel Arc GPUs. Follows the base model license (Apache-2.0).
Recipe
| Setting | Value |
|---|---|
| Tool | Intel auto-round 0.15.1, auto_round:llm_compressor (CT pack-quantized) export |
| Weights | int4 symmetric, group 128 |
| Activations | dynamic int8 (act_bits 8, per-token) |
| Calibration | nvidia/OpenCodeInstruct (128 samples x 2048 tokens) |
| torch.compile | explicitly disabled (Triton inductor failure on XPU) |
| Kept in BF16 | lm_head, visual tower (model.visual.* ignored) |
| Quant time | ~6.5 h on one Intel Arc Pro B70 (GPU1) |
Speed (measured, not estimated)
Single-stream decode, 128 streamed tokens requested (76 generated, natural stop; temperature 0,
prompt: "Explain why the sky is blue in one short paragraph"), OpenAI-compatible /v1/chat/completions
streaming, tokens counted after time-to-first-token:
| Checkpoint | Decode | TTFT | Backend |
|---|---|---|---|
| This repo (Pi W4A8-dynamic) | 33.0 t/s (3/3 runs) | 0.08 s | dynamic act-quant path |
This repo + DFlash draft (--spec-method dflash, block 8) |
~55 t/s (54.6–56.4, 3 runs) | 0.09 s warm | speculative decode, acceptance 2.71/8 |
| LeoHyperlink/Sage-1.5-W4A16 (same box and protocol, W4A16 reference) | 104.3 t/s | 0.06 s | XPUwNa16LinearKernel (fused) |
Dynamic activation quantization costs ~3x vs the fused W4A16 path on this XPU stack. Coherent output on all runs, byte-identical between plain and speculative decode (temperature 0).
Speculative decoding (DFlash)
The 1.9B DFlash draft (block-diffusion drafter for Qwen3.8)
was served alongside the quant on a single B70 (--spec-model incoai/Qwen3.8-27B-DFlash2 --spec-tokens 8,
--per-request-spec-decode-metrics summary): ~55 t/s, a 1.7x speedup over plain decode, same prompt and
protocol. Acceptance: mean length 2.71 per 8-token block, draft rate 21.4% (48/224 tokens over 28 steps) —
modest because the draft was trained for base Qwen3.8 while the target is the pi-quant; a matched draft would
do better. First-request TTFT was 1.33s cold (draft warmup), then 0.09s warm.
Fit note: target + draft weights (20.3 GB) + graphs (4.9 GB) leave almost no room for KV cache on one 32 GB
card — the spec serve needed --max-model-len 1024 --max-num-seqs 16 --gpu-memory-utilization 0.95
(KV need 1.68 GB vs 1.64 GB available at len 1024 / seqs 64; halving seqs closed the gap). Batch-1 decode
speed is unaffected by these reservations. Tensor-parallel (TP=2) was attempted to relieve this but is
blocked on this box: oneCCL cannot initialize (mem_to_ipc_handle: invalid_fd, all IPC-exchange modes fail).
Benchmarks
Humanity's Last Exam (HLE): 12.14%
Full text-only set (2,158/2,158 samples), paper-faithful config via inspect_evals/hle
(CAIS team's original.yaml-equivalent: hle/json_judge scorer, single attempt, no multi-modal):
| Metric | Value |
|---|---|
| Original accuracy | 12.14% (262/2158; 3 samples unscored) |
| Stderr | 0.70% |
| Run wall time | 4 d 9 h |
| Tokens | 57.6 M total — 54.3 M reasoning (≈25 k reasoning tok/sample, thinking xhigh) |
Setup:
- Solver = this quant (thinking default/xhigh, temperature 0, max_tokens 32768, streaming forced), served via a vLLM TP=2 OpenAI-compatible endpoint.
- Grader = the same quant answering a JSON-judge prompt (
max_grader_attempts 1).
Caveats:
- Self-graded: no external judge (e.g. o3-mini) was used — the quant judges its own answers. Plan-level judge disagreement adds unknown bias, plausibly downwards.
- Text-only, no tools: the base card's HLE 55.1 is with tools; this run is single-shot text-only. The two numbers must not be read against each other as a quantization recovery claim.
- Raw per-sample transcripts and scores:
benchmarks/hle-full.eval(inspect_ai.evalarchive).
SciCode: 4.6% test (3/65), 33.3% val (5/15)
Upstream inspect_ai harness from the SciCode repo (github.com/scicode-bench/SciCode), no background prompts,
temperature 0, streaming, test_data.h5 numeric grading:
| Split | Main-problem solve | Substep correctness | Tokens |
|---|---|---|---|
| test (65 problems) | 4.6% (3/65) | 30.2% (88/291) | 9.0 M |
| validation (15 problems) | 33.3% (5/15) | 48.0% (24/50) | 0.84 M |
Caveats:
- Run background-free (zero-shot, no doc-comment context in the prompt) — a strictly harder setting than the paper's default with-background mode; the val:test gap (33% → 4.6%) reflects that the test split is novel research problems rather than routine physics code.
- Several substeps (≈12) ended in "fail to extract python code" — the model's output did not yield a parseable script under the harness's extraction rules, scoring 0 regardless of the underlying reasoning quality.
- Raw logs:
benchmarks/scicode-test.eval,benchmarks/scicode-val.eval.
Tested hardware / software
- GPU: Intel Arc Pro B70 32 GB (Battlemage Xe2), single GPU
- Serving stack: vLLM-XPU 0.32.0 fork, torch 2.x +XPU, oneCCL
- Serve flags:
--trust-remote-code --max-model-len 8192 --max-num-seqs 128 --gpu-memory-utilization 0.9 --language-model-only --kv-cache-dtype fp8 --enable-prefix-cachingplus--default-chat-template-kwargs '{"enable_thinking": false}'. Note: this is a Mamba-hybrid model — only 159 Mamba cache blocks fit at 0.9 utilization, somax_num_seqsmust stay at or below 159 (default 256 fails engine init).ZE_AFFINITY_MASK=0.0crashes engine init on this build; GPU pinned viaONEAPI_DEVICE_SELECTOR=level_zero:N.
Usage
pip install "vllm>=0.32" # XPU fork (vllm-xpu) on Intel GPUs
vllm serve LeoHyperlink/Qwen3.8-27B-Pi-W4A8 --trust-remote-code \
--max-model-len 8192 --max-num-seqs 128 --gpu-memory-utilization 0.9 --language-model-only
Files
model-0000[1-4]-of-00004.safetensors(~18.5 GB) +model.safetensors.index.json— quantized weights (MTP headsmtp.*included in the main checkpoint)model_extra_tensors.safetensors(849 MB) — raw passthrough tensors, kept for faithfulness. vLLM 0.32.0 cannot load them alongside the CT main checkpoint; text-only serving does not need them.quantization_config.json— compressed-tensors pack-quantized specconfig.json, tokenizer files,preprocessor/processorconfigs,chat_template.jinja,generation_config.jsonbenchmarks/hle-full.eval,benchmarks/scicode-test.eval,benchmarks/scicode-val.eval— rawinspect_aieval logs (full per-sample transcripts + scores).eval_results/hle.yaml— machine-readable HLE score card (Hub eval-results schema; SciCode's dataset is README-only as it is not a registered benchmark)
Limitations
- HLE 12.14% is text-only and self-graded (the quant judges itself, no o3-mini judge); the base card's HLE 55.1 is a with-tools agentic setting — see Benchmarks caveats, they are not comparable.
- SciCode 4.6% is a no-background zero-shot run; with-background and tool-using settings score materially higher.
- Not yet run: SWE-bench Pro and Terminal-Bench 2.1 (harness setup pending).
- MTP speculative decoding is NOT enabled by this checkpoint (MTP weights ship in the main checkpoint but are
unused;
--spec-method qwen3_5_mtpexists in the serving build and is untested). Speculative decoding WAS validated via the DFlash draft path instead (see above). - Tensor-parallel serving is blocked on this box (oneCCL IPC init failure); all serves above are single-GPU.
- The visual tower ships unquantized and was not exercised (
--language-model-onlyserving).
Citation
No new training was done for this quant — if you use it, cite the base model (bytkim/Qwen3.8-27B-pi) and link back to this repo for the quantization recipe and serving numbers.
- Downloads last month
- 316
Model tree for LeoHyperlink/Qwen3.8-27B-Pi-W4A8
Evaluation results
- Original accuracy on HLEtest set Model card (benchmarks/hle-full.eval raw log)0.121
- Main-problem solve rate on SciCodetest set Model card (benchmarks/scicode-test.eval raw log)0.046
- Substep correctness on SciCodetest set Model card (benchmarks/scicode-test.eval raw log)0.302