Qwen3-4B-Instruct-2507-8bit

8-bit quantized version of Qwen/Qwen3-4B-Instruct-2507 using bitsandbytes LLM.int8(). Runs on a single consumer GPU with ~5-6 GB VRAM.

Quantization Details

Field Value
Quantization method bitsandbytes
Precision 8-bit weights (load_in_8bit: true)
llm_int8_threshold 6.0
Base model Qwen/Qwen3-4B-Instruct-2507
File size (model.safetensors) 4.42 GB
Estimated VRAM ~5.5 GB

Model Specs (from config.json)

  • Architecture: Qwen3ForCausalLM (qwen3)
  • Parameters: 4B
  • Hidden size: 2560, Layers: 36, Heads: 32, KV heads: 8
  • Context length: 262,144 tokens
  • Vocab size: 151,936
  • Base dtype: bfloat16
  • Tie word embeddings: true

How to Use

Transformers

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "Demondiablo/Qwen3-4B-Instruct-2507-8bit"

tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    load_in_8bit=True,
    device_map="auto",
    torch_dtype=torch.float16,
)

messages = [{"role": "user", "content": "Hello, who are you?"}]
text = tokenizer.apply_chat_template(
    messages, tokenize=False, add_generation_prompt=True
)
inputs = tokenizer(text, return_tensors="pt").to(model.device)

outputs = model.generate(**inputs, max_new_tokens=256, do_sample=True, temperature=0.7)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

This model uses bitsandbytes 8-bit quantization. Install it with pip install bitsandbytes.

vLLM

vLLM does not support bitsandbytes 8-bit directly. Use the AWQ 4-bit version for vLLM, or use Transformers / llama.cpp for this 8-bit build.

License

Apache 2.0. See the original model card for full details.

Downloads last month
55
Safetensors
Model size
4B params
Tensor type
F32
路
BF16
路
I8
路
Inference Providers NEW
This model isn't deployed by any Inference Provider. 馃檵 Ask for provider support

Model tree for Demondiablo/Qwen3-4B-Instruct-2507-8bit

Quantized
(377)
this model