Instructions to use Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF") 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("Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF", dtype="auto") - llama-cpp-python
How to use Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF", filename="Qwen3.6-27B-vocabulary-trimming-MTP-Q4_K_S.gguf", )
llm.create_chat_completion( 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" } } ] } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Elsephire/Qwen3.6-27B-vocabulary-trimming-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 Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF:Q4_K_S # Run inference directly in the terminal: llama cli -hf Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF:Q4_K_S
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF:Q4_K_S # Run inference directly in the terminal: llama cli -hf Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF:Q4_K_S
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 Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF:Q4_K_S # Run inference directly in the terminal: ./llama-cli -hf Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF:Q4_K_S
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 Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF:Q4_K_S # Run inference directly in the terminal: ./build/bin/llama-cli -hf Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF:Q4_K_S
Use Docker
docker model run hf.co/Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF:Q4_K_S
- LM Studio
- Jan
- vLLM
How to use Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Elsephire/Qwen3.6-27B-vocabulary-trimming-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": "Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF", "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/Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF:Q4_K_S
- SGLang
How to use Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF 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 "Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF" \ --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": "Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF", "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 "Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF" \ --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": "Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF", "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 Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF with Ollama:
ollama run hf.co/Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF:Q4_K_S
- Unsloth Studio
How to use Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF 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 Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF 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 Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF to start chatting
- Pi
How to use Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF:Q4_K_S
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": "Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF:Q4_K_S" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use Elsephire/Qwen3.6-27B-vocabulary-trimming-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 Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF:Q4_K_S
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 Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF:Q4_K_S
Run Hermes
hermes
- Atomic Chat new
- OpenClaw new
How to use Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF:Q4_K_S
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 "Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF:Q4_K_S" \ --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 Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF with Docker Model Runner:
docker model run hf.co/Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF:Q4_K_S
- Lemonade
How to use Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Elsephire/Qwen3.6-27B-vocabulary-trimming-GGUF:Q4_K_S
Run and chat with the model
lemonade run user.Qwen3.6-27B-vocabulary-trimming-GGUF-Q4_K_S
List all available models
lemonade list
Create README.md
Browse files|
@@ -0,0 +1,156 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
license_link: https://huggingface.co/Qwen/Qwen3.6-27B/blob/main/LICENSE
|
| 4 |
+
language:
|
| 5 |
+
- en
|
| 6 |
+
- fr
|
| 7 |
+
- de
|
| 8 |
+
- es
|
| 9 |
+
- it
|
| 10 |
+
- pl
|
| 11 |
+
- nl
|
| 12 |
+
- ro
|
| 13 |
+
- hu
|
| 14 |
+
base_model:
|
| 15 |
+
- Qwen/Qwen3.6-27B
|
| 16 |
+
library_name: transformers
|
| 17 |
+
tags:
|
| 18 |
+
- merge
|
| 19 |
+
- text-generation-inference
|
| 20 |
+
- mtp
|
| 21 |
+
- image-text-to-text
|
| 22 |
+
---
|
| 23 |
+
|
| 24 |
+
# Qwen3.6-27B-Trimmed
|
| 25 |
+
|
| 26 |
+
A vocabulary-trimmed version of Qwen3.6-27B with **41.3% fewer tokens**, keeping only Latin (EN, FR, DE, ES, IT, PT, NL, PL, RO, HU) and Greek scripts while preserving all original capabilities in those languages.
|
| 27 |
+
|
| 28 |
+
---
|
| 29 |
+
|
| 30 |
+
## π Trimming Statistics
|
| 31 |
+
|
| 32 |
+
| Metric | Original | Trimmed | Gain |
|
| 33 |
+
|--------|----------|---------|------|
|
| 34 |
+
| Vocabulary size | 248,077 tokens | 145,570 tokens | β41.3% |
|
| 35 |
+
| File size | 19,381.0 MB | 17,378.9 MB | β2002.1 MB (10.33%) |
|
| 36 |
+
| Parameters | 10,161.2 M | 10,161.2 M | unchanged |
|
| 37 |
+
| Architecture | Dense | Dense | unchanged |
|
| 38 |
+
|
| 39 |
+
### Original vocabulary distribution by script
|
| 40 |
+
|
| 41 |
+
| Script / Language | Tokens | % of vocabulary | Status |
|
| 42 |
+
|-------------------|--------|------------------|--------|
|
| 43 |
+
| Latin (EN, FR, DE, ES, IT, PT, NL, PL, RO, HU) | 144,029 | 58.1% | β
Kept |
|
| 44 |
+
| Chinese / Japanese / Korean | 65,722 | 26.5% | β Removed |
|
| 45 |
+
| Cyrillic (RU, UK, BG, SR, MK) | 18,580 | 7.5% | β Removed |
|
| 46 |
+
| Arabic | 8,817 | 3.6% | β Removed |
|
| 47 |
+
| Thai | 5,741 | 2.3% | β Removed |
|
| 48 |
+
| Greek | 1,543 | 0.6% | β
Kept |
|
| 49 |
+
| Devanagari (Hindi, Nepali, Marathi) | 959 | 0.4% | β Removed |
|
| 50 |
+
| Bengali | 531 | 0.2% | β Removed |
|
| 51 |
+
| Hebrew | 520 | 0.2% | β Removed |
|
| 52 |
+
| Tamil | 268 | 0.1% | β Removed |
|
| 53 |
+
| Malayalam | 205 | 0.1% | β Removed |
|
| 54 |
+
| Telugu | 188 | 0.1% | β Removed |
|
| 55 |
+
| Georgian | 186 | 0.1% | β Removed |
|
| 56 |
+
| Burmese | 147 | 0.1% | β Removed |
|
| 57 |
+
| Kannada | 144 | 0.1% | β Removed |
|
| 58 |
+
| Gujarati | 116 | 0.0% | β Removed |
|
| 59 |
+
| Armenian | 88 | 0.0% | β Removed |
|
| 60 |
+
| Khmer | 79 | 0.0% | β Removed |
|
| 61 |
+
| Sinhala | 77 | 0.0% | β Removed |
|
| 62 |
+
| Gurmukhi (Punjabi) | 65 | 0.0% | β Removed |
|
| 63 |
+
| Lao | 37 | 0.0% | β Removed |
|
| 64 |
+
| Ethiopic (Ge'ez) | 25 | 0.0% | β Removed |
|
| 65 |
+
| Tibetan | 10 | 0.0% | β Removed |
|
| 66 |
+
| Braille | 2 | 0.0% | β Removed |
|
| 67 |
+
|
| 68 |
+
---
|
| 69 |
+
|
| 70 |
+
## π― Why Trim?
|
| 71 |
+
|
| 72 |
+
### Eliminating random Asian characters
|
| 73 |
+
|
| 74 |
+
One of the most common issues with general multilingual models is the sporadic appearance of Chinese, Japanese, or Korean characters in outputs meant for Latin-script languages β even when the prompt has nothing to do with those languages. This happens because the model occasionally explores parts of the vocabulary that are never actively used for the target task. By permanently removing those tokens, this issue is **resolved at a structural level**: the model simply cannot generate them anymore, as they no longer exist in its output space.
|
| 75 |
+
|
| 76 |
+
### Faster generation and prompt processing
|
| 77 |
+
|
| 78 |
+
Reducing the vocabulary size has a direct and measurable impact on speed:
|
| 79 |
+
|
| 80 |
+
- **Prompt processing (prefill)** β The embedding matrix is smaller, which reduces load time and memory access during the prefill phase.
|
| 81 |
+
- **Token-by-token generation (decoding)** β The search for the best token in the output distribution (softmax + argmax) operates over a **41.3% smaller space**. This translates into faster decoding, especially on hardware where the softmax computation is the bottleneck.
|
| 82 |
+
|
| 83 |
+
### Reduced memory footprint
|
| 84 |
+
|
| 85 |
+
- **Storage** β The model file is **2002.1 MB smaller** (10.33% reduction).
|
| 86 |
+
- **RAM / VRAM** β The embedding matrix (`lm_head` + `embed_tokens`) occupies proportionally less memory. On systems with tight memory constraints, this reduction can make it possible to run the model where it previously wouldn't fit, or free up memory for other processes.
|
| 87 |
+
|
| 88 |
+
### Potential performance improvement (1β3%)
|
| 89 |
+
|
| 90 |
+
Trimming the vocabulary may lead to a slight improvement in overall model performance on the retained languages. The hypothesis is that reducing the output space concentrates probability mass more effectively on relevant tokens, reducing the statistical noise introduced by thousands of tokens that are never used in the task context. Gains in the range of **1β3%** may be observed on Latin-language benchmarks (perplexity, answer accuracy, coherence).
|
| 91 |
+
|
| 92 |
+
---
|
| 93 |
+
|
| 94 |
+
## π§ Methodology
|
| 95 |
+
|
| 96 |
+
Trimming was performed using the [vocab-trimmer] release soon tool, which follows this pipeline:
|
| 97 |
+
|
| 98 |
+
1. **Vocabulary analysis** β Each token in the original tokenizer is classified by Unicode script (Latin, CJK, Cyrillic, Arabic, etc.).
|
| 99 |
+
2. **Selective filtering** β Only Latin and Greek scripts are kept. Special tokens (EOS, BOS, PAD, etc.) and multimodal tokens are always preserved.
|
| 100 |
+
3. **ID remapping** β A continuous `old_id β new_id` mapping is built to compact the vocabulary with no gaps.
|
| 101 |
+
4. **Weight slicing** β Only the rows of the embedding matrices corresponding to retained tokens are extracted. The `lm_head` and `embed_tokens` layers are recalibrated.
|
| 102 |
+
5. **Configuration reconstruction** β `tokenizer_config.json`, `tokenizer.json`, `config.json`, and the vocabulary are rebuilt with the new IDs. Chat templates and special tokens are preserved verbatim.
|
| 103 |
+
6. **Verification** β Consistency between tokenizer and weights is validated (special token IDs < vocab_size, functional chat template, etc.).
|
| 104 |
+
|
| 105 |
+
---
|
| 106 |
+
|
| 107 |
+
## β οΈ Limitations
|
| 108 |
+
|
| 109 |
+
- **Unsupported languages** β This model **cannot** generate text in Chinese, Japanese, Korean, Russian, Arabic, Thai, Hindi, Bengali, Hebrew, or any other language whose tokens were removed. Prompts in these languages will not be understood correctly.
|
| 110 |
+
- **Supported languages** β Functional languages include English, French, German, Spanish, Italian, Portuguese, Dutch, Polish, Romanian, Hungarian, and Greek.
|
| 111 |
+
- **Code & Math** β Programming and mathematical tokens are preserved (they primarily use Latin encoding). No loss of capability is expected in these domains.
|
| 112 |
+
- **Emojis & Symbols** β Common Unicode symbols and emojis are retained if they fall within the selected scripts.
|
| 113 |
+
|
| 114 |
+
---
|
| 115 |
+
|
| 116 |
+
## π Model files
|
| 117 |
+
|
| 118 |
+
| File | Description |
|
| 119 |
+
|------|-------------|
|
| 120 |
+
| `model.safetensors` | Model weights (SafeTensors format) |
|
| 121 |
+
| `config.json` | Model configuration |
|
| 122 |
+
| `tokenizer_config.json` | Tokenizer configuration |
|
| 123 |
+
| `tokenizer.json` | Added tokenizer (BPE) |
|
| 124 |
+
| `tokenizer.model` | Original SentencePiece model |
|
| 125 |
+
| `merges.txt` | BPE merge operations |
|
| 126 |
+
|
| 127 |
+
---
|
| 128 |
+
|
| 129 |
+
## π‘ Usage
|
| 130 |
+
|
| 131 |
+
```python
|
| 132 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 133 |
+
|
| 134 |
+
model_id = "your-namespace/Qwen3.6-27B-vocabulary-trimming"
|
| 135 |
+
|
| 136 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 137 |
+
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto")
|
| 138 |
+
|
| 139 |
+
inputs = tokenizer("Explain quantum computing in simple terms.", return_tensors="pt").to(model.device)
|
| 140 |
+
outputs = model.generate(**inputs, max_new_tokens=256)
|
| 141 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 142 |
+
```
|
| 143 |
+
|
| 144 |
+
---
|
| 145 |
+
|
| 146 |
+
## π License
|
| 147 |
+
|
| 148 |
+
This model is derived from [Qwen/Qwen3.6-27B](https://huggingface.co/Qwen/Qwen3.6-27B) and follows its original license. The trimming tool [vocab-trimmer] release soon is available under the MIT License.
|
| 149 |
+
|
| 150 |
+
---
|
| 151 |
+
|
| 152 |
+
## π References
|
| 153 |
+
|
| 154 |
+
- **Original model** : [Qwen/Qwen3.6-35B-A3B](https://huggingface.co/Qwen/Qwen3.6-27B)
|
| 155 |
+
- **Trimming tool** : [vocab-trimmer] release soon
|
| 156 |
+
- **Qwen Team** : [Alibaba Cloud β Qwen Team](https://qwenlm.github.io/)
|