Downloads · 30 days
24
1% of all-time downloads
elon-trump/Qwen3.6-27B-4bit-text-only
Qwen3.6-27B-4bit-text-only is a text generation model from elon-trump. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
<div align="center" <img width="300px" src="https://qianwen-res.oss-accelerate.aliyuncs.com/Qwen3.6/logo.png" <h1Qwen3.6-27B-4bit-text-only</h1 <p4-bit NF4 Quantized Text-Only Version (No Vision)</p </div
Downloads · 30 days
24
1% of all-time downloads
All-time downloads
2.1K
Public
Parameters
27.7B
17.7 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors17.7 GB · 100%
How the weights are stored.
U825.1B · 91%
From the Hugging Face model README
[!WARNING] TEXT-ONLY MODEL: This quantized version does NOT have vision/multimodal capabilities. The original Qwen3.6-27B is a multimodal model (text + image), but quantization with bitsandbytes +
AutoModelForCausalLMstrips vision components. For vision support, use the original model.
[!IMPORTANT] This is a 4-bit NF4 quantized version of Qwen3.6-27B. The 17GB disk size is compressed - actual GPU memory usage is ~16GB with Transformers or ~14-15GB with vLLM.
Recommended: 24GB+ GPU (RTX 4090, A5000) Minimum: 16GB GPU with vLLM (not Transformers)
| Attribute | Value |
|---|---|
| Base Model | Qwen3.6-27B |
| Quantization | 4-bit NF4 (Normal Float) |
| Method | bitsandbytes with double quantization |
| Original Size | ~57 GB (FP16/BF16) |
| Disk Size | ~17 GB (compressed) |
| VRAM (Transformers) | ~16.4 GB |
| VRAM (vLLM) | ~14-15 GB |
| Recommended GPU | 24GB+ VRAM |
| Compute Dtype | bfloat16 |
| Modality | Text-Only (No vision/multimodal) |
[!NOTE] Why Text-Only? The original Qwen3.6-27B is a multimodal model (
Qwen3_5ForConditionalGeneration) that supports image+text input. However, quantizing withbitsandbytes+AutoModelForCausalLMconverts it to text-only (Qwen3_5ForCausalLM). The config has been manually fixed toQwen3_5ForConditionalGeneration, but vision components are not included in the quantized weights.
pip install transformers bitsandbytes accelerate torch
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
model_path = "/path/to/Qwen3.6-27B-4bit"
# Load model and tokenizer
tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_path,
device_map="cuda",
torch_dtype=torch.bfloat16,
)
# Generate response
prompt = "Write a binary search function in Python"
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
with torch.no_grad():
outputs = model.generate(**inputs, max_new_tokens=200, do_sample=False)
response = tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True)
print(response)
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
model_path = "/path/to/Qwen3.6-27B-4bit"
tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_path,
device_map="cuda",
torch_dtype=torch.bfloat16,
)
# Use chat template for conversation
messages = [{"role": "user", "content": "Implement a stack class in Python"}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to("cuda")
with torch.no_grad():
outputs = model.generate(**inputs, max_new_tokens=200, do_sample=False)
response = tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True)
print(response)
# Install vLLM
pip install vllm>=0.5.0
# Serve the model
vllm serve Qwen3.6-27B-4bit --quantization nf4 --dtype half
# Or run with OpenAI-compatible API
vllm serve Qwen3.6-27B-4bit --quantization nf4 --host 0.0.0.0 --port 8000
| GPU Tier | VRAM | Support | Notes |
|---|---|---|---|
| RTX 4090 | 24GB | ✓ Excellent | Recommended |
| RTX 4080 | 16GB | ◐ vLLM only | Use vLLM for best fit |
| A5000 | 24GB | ✓ Excellent | Recommended |
| A4000 | 16GB | ◐ vLLM only | Use vLLM for best fit |
| A100 | 40/80GB | ✓ Excellent | Handles easily |
| L40 | 48GB | ✓ Excellent | Excellent |
Verified on A100 80GB PCIe GPU.
| Task | Status | Notes |
|---|---|---|
| Binary Search | ✓ Pass | Correct pivot-based implementation |
| Quick Sort | ✓ Pass | Correct partitioning logic |
| Merge Sort | ✓ Pass | Correct divide & merge |
| Fibonacci | ✓ Pass | Working recursive implementation |
| Linked List | ✓ Pass | Full Node + LinkedList class |
| Stack | ✓ Pass | push/pop/is_empty methods |
| Queue | ✓ Pass | enqueue/dequeue methods |
| LRU Cache | ✓ Pass | Cache with order tracking |
| Binary Tree | ✓ Pass | TreeNode + insert function |
| Graph DFS | ✓ Pass | Recursive with visited set |
| Decorators | ✓ Pass | @timing_decorator pattern |
| Context Manager | ✓ Pass | enter and exit |
| Exception Handling | ✓ Pass | Multiple exception types |
| Test | Input | Output | Status |
|---|---|---|---|
| Basic Math | 23 * 17 | 391 | ✓ Pass |
| Square Root | sqrt(144) | 12 | ✓ Pass |
| Primes | primes < 10 | 2, 3, 5, 7 | ✓ Pass |
| Binary Conversion | 1010 (binary) | 10 (decimal) | ✓ Pass |
| FizzBuzz | Implement | Working code | ✓ Pass |
| Pattern | Status |
|---|---|
| Bug Fixes | ✓ Pass |
| Code Optimization | ✓ Pass |
| List Comprehensions | ✓ Pass |
| Dict Comprehensions | ✓ Pass |
| Decorators | ✓ Pass |
| Context Managers | ✓ Pass |
| Exception Handling | ✓ Pass |
Compared against original FP16 model:
| Test Case | Original (FP16) | Quantized (4-bit) | Match |
|---|---|---|---|
| Basic Math (2+2) | "2+2 is equal to 4" | Same | ✓ Identical |
| Prime Check | "Yes" | Same | ✓ Identical |
| Python print | print("Hello") | Same | ✓ Identical |
| Binary Search | Correct implementation | Same | ✓ Identical |
Token Similarity: ~90%+ with base FP16 model
.
├── model.safetensors # Quantized model weights (17GB)
├── config.json # Model configuration
├── tokenizer.json # Tokenizer data
├── tokenizer_config.json
├── generation_config.json
├── chat_template.jinja
├── .gitattributes
├── LICENSE
└── README.md
The model was quantized using the following configuration:
from transformers import BitsAndBytesConfig
import torch
quantization_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4", # Normal Float 4-bit
bnb_4bit_compute_dtype=torch.bfloat16,
bnb_4bit_use_double_quant=True, # Double quantization for size reduction
)
The quantization was performed using AutoModelForCausalLM which caused the following:
Architecture Change: Original model uses Qwen3_5ForConditionalGeneration (multimodal). The quantized config was changed to Qwen3_5ForCausalLM (text-only). This has been manually fixed in config.json.
Vision Capabilities Lost: The original Qwen3.6-27B supports image+text input. The quantized version is text-only as vision components are not preserved by bitsandbytes quantization.
model_type Change: The quantization changed model_type from qwen3_5 to qwen3_5_text. This has been manually fixed in config.json.
[!IMPORTANT] If you need multimodal capabilities, use the original model:
Qwen/Qwen3.6-27B
This model works well with popular agent frameworks:
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
model_path,
device_map="auto",
max_memory={0: "14GB", "cpu": "30GB"}, # Offload to CPU for 16GB cards
torch_dtype=torch.bfloat16,
)
from langchain_community.llms import HuggingFacePipeline
from transformers import pipeline
pipe = pipeline(
"text-generation",
model="/path/to/Qwen3.6-27B-4bit",
device_map="auto",
token="your_token"
)
llm = HuggingFacePipeline(pipeline=pipe)
from litellm import litellm
response = litellm.completion(
model="huggingface/Qwen3.6-27B-4bit",
messages=[{"role": "user", "content": "Write a hello world program"}],
api_key="your_token"
)
# Recommended settings for code generation
generation_kwargs = {
"max_new_tokens": 512,
"temperature": 0.2,
"do_sample": False, # Use False for deterministic output
"top_p": 0.95,
"top_k": 20,
}
outputs = model.generate(**inputs, **generation_kwargs)
Apache 2.0 - See LICENSE for full license text.