Instructions to use HattoriHanzo1/Qwen-3.8-27B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HattoriHanzo1/Qwen-3.8-27B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="HattoriHanzo1/Qwen-3.8-27B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("HattoriHanzo1/Qwen-3.8-27B", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use HattoriHanzo1/Qwen-3.8-27B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "HattoriHanzo1/Qwen-3.8-27B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HattoriHanzo1/Qwen-3.8-27B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/HattoriHanzo1/Qwen-3.8-27B
- SGLang
How to use HattoriHanzo1/Qwen-3.8-27B 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 "HattoriHanzo1/Qwen-3.8-27B" \ --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": "HattoriHanzo1/Qwen-3.8-27B", "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 "HattoriHanzo1/Qwen-3.8-27B" \ --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": "HattoriHanzo1/Qwen-3.8-27B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use HattoriHanzo1/Qwen-3.8-27B with Docker Model Runner:
docker model run hf.co/HattoriHanzo1/Qwen-3.8-27B
Qwen3.8-27B โ Fixed Chat Template (merged v1.0)
This repository provides a replacement chat_template.jinja for Qwen/Qwen3.8-27B, intended for use with llama.cpp / llama-server (and any GGUF-based backend that accepts a custom chat template).
Why this repo exists
The stock chat template shipped with Qwen3.8-27B crashes with a hard exception when a system / developer message is not the first message in the conversation (e.g. when an agent or client injects system content mid-conversation). With llama-server this surfaces as:
operator(): got exception: {"error":{"code":500,"message":"
------------
While executing CallExpression at line 110, column 28 in source:
...eveloper\" %}
{{- raise_exception('System message must be at the beginnin...
^
Error: Jinja Exception: System message must be at the beginning.","type":"server_error"}}
This template eliminates that error. System and developer messages are accepted at any position in the message list and are rendered in place, instead of raising Jinja Exception: System message must be at the beginning.
What the template supports
system/developermessages at any position โ no hard exception- Thinking / reasoning control via
enable_thinkingandreasoning_effort(xhigh(default),medium,low) preserve_thinkingfor multi-turn reasoning continuity- Tool calling: function schemas injected in the system block,
<tool_call>/<function>rendering, multi-step tool loops - Vision: image (
Picture N:) and video (Video N:) placeholders viaadd_vision_id
Usage
Point your backend at this file:
# llama-server
# or any other GGUF from the Qwen 3.8 27B family โ this template fits the whole family and looks very good with all of them
llama-server \
-m /path/to/Qwen3.8-27B-Q5_K_S.gguf \
--jinja \
--chat-template /path/to/chat_template.jinja
Or any other Qwen 3.8 27B GGUF (any quant, any GGUF build of the family) โ set the chat template to the contents of chat_template.jinja in any client that allows a custom Jinja chat template (e.g. pi's llamacpp provider, Ollama's TEMPLATE, LM Studio's chat template field).
Files
| File | Description |
|---|---|
chat_template.jinja |
The fixed chat template (merged v1.0) |
Notes
- Weights are not included in this repo โ this is a chat-template-only fix for the base model listed above.
- If you hit a template error, verify your backend actually supports the Jinja features used (
namespace,raise_exception); llama.cpp โฅ 0.16 is recommended.
Model tree for HattoriHanzo1/Qwen-3.8-27B
Base model
Qwen/Qwen3.8-27B