01

Basic information

Model repository: Qwen/Qwen3-8B
Organization: Qwen
Tasks: text-generation

02

Architecture and runtime

Model type: qwen3
Architecture: Not provided
Libraries: transformer, safetensors, pytorch
Base models: Qwen/Qwen3-8B-Base
Current revision: master

03

License and update history

License: apache-2.0
Created: 2025-04-30
Last updated: 2025-12-02

04

Hardware requirements

参考配置(非官方最低要求):BF16 权重约 16.4 GB,实用起步显存建议 24 GB及以上。长上下文还需额外为 KV cache 预留显存。4-bit 量化权重约 4—6 GB,实际运行需要更多显存。 Inference estimate (not an official minimum): BF16 weights are about 16.4 GB; 24 GB VRAM is a practical starting point. Long contexts require additional KV-cache memory. 4-bit weights are roughly 4-6 GB before runtime overhead.

05

Download links

06

Basic usage example

Transformers 快速推理 / Transformers quick inference

# pip install -U "transformers>=4.51.0" accelerate torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "Qwen/Qwen3-8B"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id, torch_dtype="auto", device_map="auto"
)
messages = [{"role": "user", "content": "你好,请用三点简要介绍人工智能。"}]
prompt = tokenizer.apply_chat_template(
    messages, tokenize=False, add_generation_prompt=True,
    enable_thinking=False
)
inputs = tokenizer([prompt], return_tensors="pt").to(model.device)
output = model.generate(**inputs, max_new_tokens=128)
print(tokenizer.decode(
    output[0][inputs.input_ids.shape[1]:], skip_special_tokens=True
))