Instructions to use AlexanderKyng/Qwen3.8-27B-48Gb with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AlexanderKyng/Qwen3.8-27B-48Gb with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="AlexanderKyng/Qwen3.8-27B-48Gb") 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)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("AlexanderKyng/Qwen3.8-27B-48Gb", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use AlexanderKyng/Qwen3.8-27B-48Gb 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 AlexanderKyng/Qwen3.8-27B-48Gb:Q8_0 # Run inference directly in the terminal: llama cli -hf AlexanderKyng/Qwen3.8-27B-48Gb:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf AlexanderKyng/Qwen3.8-27B-48Gb:Q8_0 # Run inference directly in the terminal: llama cli -hf AlexanderKyng/Qwen3.8-27B-48Gb:Q8_0
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 AlexanderKyng/Qwen3.8-27B-48Gb:Q8_0 # Run inference directly in the terminal: ./llama-cli -hf AlexanderKyng/Qwen3.8-27B-48Gb:Q8_0
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 AlexanderKyng/Qwen3.8-27B-48Gb:Q8_0 # Run inference directly in the terminal: ./build/bin/llama-cli -hf AlexanderKyng/Qwen3.8-27B-48Gb:Q8_0
Use Docker
docker model run hf.co/AlexanderKyng/Qwen3.8-27B-48Gb:Q8_0
- LM Studio
- Jan
- vLLM
How to use AlexanderKyng/Qwen3.8-27B-48Gb with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AlexanderKyng/Qwen3.8-27B-48Gb" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AlexanderKyng/Qwen3.8-27B-48Gb", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/AlexanderKyng/Qwen3.8-27B-48Gb:Q8_0
- SGLang
How to use AlexanderKyng/Qwen3.8-27B-48Gb 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 "AlexanderKyng/Qwen3.8-27B-48Gb" \ --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": "AlexanderKyng/Qwen3.8-27B-48Gb", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "AlexanderKyng/Qwen3.8-27B-48Gb" \ --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": "AlexanderKyng/Qwen3.8-27B-48Gb", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Ollama
How to use AlexanderKyng/Qwen3.8-27B-48Gb with Ollama:
ollama run hf.co/AlexanderKyng/Qwen3.8-27B-48Gb:Q8_0
- Unsloth Studio
How to use AlexanderKyng/Qwen3.8-27B-48Gb 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 AlexanderKyng/Qwen3.8-27B-48Gb 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 AlexanderKyng/Qwen3.8-27B-48Gb to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for AlexanderKyng/Qwen3.8-27B-48Gb to start chatting
- Pi
How to use AlexanderKyng/Qwen3.8-27B-48Gb with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf AlexanderKyng/Qwen3.8-27B-48Gb:Q8_0
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": "AlexanderKyng/Qwen3.8-27B-48Gb:Q8_0" } ] } } }Run Pi
# Start Pi in your project directory: pi
- OpenClaw new
How to use AlexanderKyng/Qwen3.8-27B-48Gb with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf AlexanderKyng/Qwen3.8-27B-48Gb:Q8_0
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 "AlexanderKyng/Qwen3.8-27B-48Gb:Q8_0" \ --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 AlexanderKyng/Qwen3.8-27B-48Gb with Docker Model Runner:
docker model run hf.co/AlexanderKyng/Qwen3.8-27B-48Gb:Q8_0
- Lemonade
How to use AlexanderKyng/Qwen3.8-27B-48Gb with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull AlexanderKyng/Qwen3.8-27B-48Gb:Q8_0
Run and chat with the model
lemonade run user.Qwen3.8-27B-48Gb-Q8_0
List all available models
lemonade list
- Hermes Agent
How to use AlexanderKyng/Qwen3.8-27B-48Gb with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf AlexanderKyng/Qwen3.8-27B-48Gb:Q8_0
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 AlexanderKyng/Qwen3.8-27B-48Gb:Q8_0
Run Hermes
hermes
- Atomic Chat
Qwen3.8-27B-48Gb
Overview
This repository provides a highly optimized, custom-quantized GGUF model of Qwen3.8-27B, specifically engineered for local deployment on Dual RTX 3090 setups.
The primary research objective of this quantization is to achieve an extreme context length (full 262K tokens in F16 KV Cache) while maximizing inference speed through adapted BPW and Multi-Token Prediction (MTP / Self-Speculative Decoding) and retaining most of the original model's capacities. To achieve this, the base network was quantized to Q5_0 and Q8_0 using a custom iMatrix, while the critical NextN layers and embeddings were strictly preserved in Q8_0.
The base model used for this requantization is Qwen/Qwen3.8-27B.
Research & Methodology
Selective precision Quantization for high-speed inference
Most standard quantization pipelines compress the entire model, which severely degrades the quality, the inference speeds and the NextN layer responsible for Multi-Token Prediction (which is, sometimes, completely suppress it).
To maintain capacities while optimizing for a Dual RTX 3090 (NVLink) setup, I have implemented a Selective Precision Mapping strategy. By carefully partitioning the model into Q8_0 (High Precision) and Q5_0 (Balanced Efficiency) tensors, it preserves the critical activation flows, specifically the Multi-Token Prediction (NextN) layer, without sacrificing the throughput necessary for processing massive contexts (full 262K tokens).
Strategic Layer Mapping
The following quantization scheme was applied :
--tensor-type 'token_embd\.weight=q8_0'
--tensor-type 'output\.weight=q8_0'
--tensor-type 'blk\.64\..*=q8_0'
--tensor-type 'blk\.([0-9]|[1-5][0-9]|6[0-3])\.attn_qkv\.weight=q8_0'
--tensor-type 'blk\.([0-9]|[1-5][0-9]|6[0-3])\.attn_q\.weight=q8_0'
--tensor-type 'blk\.([0-9]|[1-5][0-9]|6[0-3])\.attn_k\.weight=q8_0'
--tensor-type 'blk\.([0-9]|[1-5][0-9]|6[0-3])\.attn_v\.weight=q8_0'
--tensor-type 'blk\.([0-9]|[1-5][0-9]|6[0-3])\.attn_output\.weight=q8_0'
--tensor-type 'blk\.([0-9]|[1-5][0-9]|6[0-3])\.attn_gate\.weight=q5_0'
--tensor-type 'blk\.([0-9]|[1-5][0-9]|6[0-3])\.ssm_alpha\.weight=q5_0'
--tensor-type 'blk\.([0-9]|[1-5][0-9]|6[0-3])\.ssm_beta\.weight=q5_0'
--tensor-type 'blk\.([0-9]|[1-5][0-9]|6[0-3])\.ssm_out\.weight=q8_0'
--tensor-type 'blk\.([0-9]|[1-5][0-9]|6[0-3])\.ffn_up\.weight=q5_0'
--tensor-type 'blk\.([0-9]|[1-5][0-9]|6[0-3])\.ffn_down\.weight=q5_0'
--tensor-type 'blk\.([0-9]|[1-5][0-9]|6[0-3])\.ffn_gate\.weight=q5_0'
This scheme keeps the most important layers at high precision (Q8_0) and lowers the GGUF size on disk, enabling full offload on dual RTX 3090 setups. I chose to go for Q5_0 and Q8_0 as it both retains many capacities while lowering the needs for complex mathematical kernel calculations.
iMatrix Calibration
The model was calibrated using a custom, shuffled iMatrix to ensure high fidelity across coding, instruction-following, and bilingual tasks (English/French).
The dataset was built by merging and shuffling the following subsets from eaddario/imatrix-calibration:
code_smalltools_smalltext_en_smalltext_fr_small
Accuracy Analysis
I compared the perplexity on Wiki-Text-raw to evaluate the precision loss after the mixed-quantization scheme:
| Model Version | Precision | Wiki-text-raw (PPL) | Delta vs BF16 |
|---|---|---|---|
| Q8_0-Plus | Q8_0 + F16 | 5.8285 | +0.0204 |
| Base (Source) | BF16 (Original) | 5.8081 | - |
Key Findings:
- Near-Lossless: The perplexity degradation is minimal at +0.0204, indicating that this mixed precision layout preserves the original model's reasoning capabilities.
Recommended Usage
To replicate the optimal performance (200K context, F16 Cache, Multi-GPU) using llama.cpp, use the following llama-server command. Note the specific use of --split-mode tensor and --tensor-split 1,1 for optimal PCIe bandwidth management across dual RTX 3090s. This command appeared to be the best one I could come across using an NVLink.
/path/to/llama.cpp/build/bin/llama-server \
-m /path/to/Qwen3.8-27B-Q8_0-plus\
--mmproj /path/to/mmproj-F16.gguf \
--split-mode tensor \
--tensor-split 1,1 \
--host 0.0.0.0 \
--port 8080 \
--ctx-size 262144 \
--parallel 1 \
--gpu-layers 999 \
--cache-type-k f16 \
--cache-type-v f16 \
--flash-attn on \
-b 2048 -ub 2048 \
--spec-type draft-mtp \
-sps 0.70 \
--image-min-tokens 1024 \
--alias Qwen3.6-27b \
--jinja
If I may add, I also developed a proxy to enable users to select thinking or non-thinking behaviors and applied the recommended sampling parameters AND the "Preserve Thinking" option. You may find it on my GitHub.
Hardware Requirements
- Target VRAM: 48 GB (Tested on 2x NVIDIA RTX 3090 24GB).
- RAM: Minimum 32GB system RAM (Prompt caching and system overhead).
- Context limit: The command above loads ~13GB of KV cache across the two GPUs. If you experience OOM (Out of Memory) errors, consider reducing
--ctx-sizeor using 8-bit cache (--cache-type-k q8_0 --cache-type-v q8_0).
Acknowledgments
This project was made possible thanks to the outstanding tools and contributions from the open-source AI community. Special thanks to:
- The Qwen Team: For researching and releasing the exceptional Qwen3.8 architecture.
- llama.cpp: Using the new Tensor split mode, it finally achieves extremelly high performances on dual-GPU setups.
- eaddario: For the extremely diverse
imatrix-calibrationdataset, which was crucial in building the custom, multilingual, and code-heavy iMatrix.
- Downloads last month
- 51
8-bit
Model tree for AlexanderKyng/Qwen3.8-27B-48Gb
Base model
Qwen/Qwen3.8-27B