Instructions to use Qwen/Qwen3-8B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Qwen/Qwen3-8B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Qwen/Qwen3-8B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen3-8B") model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-8B", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- HuggingChat
- Notebooks
- Google Colab
- Kaggle
- AMD Developer Cloud
- Local Apps Settings
- vLLM
How to use Qwen/Qwen3-8B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Qwen/Qwen3-8B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Qwen/Qwen3-8B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Qwen/Qwen3-8B
- SGLang
How to use Qwen/Qwen3-8B 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 "Qwen/Qwen3-8B" \ --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": "Qwen/Qwen3-8B", "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 "Qwen/Qwen3-8B" \ --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": "Qwen/Qwen3-8B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Qwen/Qwen3-8B with Docker Model Runner:
docker model run hf.co/Qwen/Qwen3-8B
Where instruction tuning landed in this pair — a propagation scan (N80 23/37, band 32–36)
We ran a before/after internal scan of Qwen/Qwen3-8B-Base → Qwen/Qwen3-8B with a fixed probe protocol (identical prompts for both models, controlled perturbations injected at seven depths, 168 matched probes per model) and thought the result was worth putting here rather than only on our own page.
Where the difference sits. 80% of the base→instruct difference mass falls in 23 of 37 stations (a station is the output of one block; 36 layers → 37 stations). The densest five-station band is 32–36, carrying 1.72× what a uniform spread would put there and 1.53× what a flat null would. The first observable difference is station 4 — that is our probe grid's detection floor (the earliest probe is injected at layer 2), not something the tuning earned.
Consistent with the other families we scanned, the band sits at the top of the network; the two Llama pairs in the same run instead concentrated mid-network, so the position is family-dependent.
Knowledge side. Factual recall barely moved: 0 of the 20 probe facts broke and 0 were repaired. What moved is behaviour on entities the model does not know — fake-name echo avoided went 12 → 16 of 20 (McNemar 5 improved / 1 regressed, exact two-sided p = 0.219), and a three-class judge reads refusals 0→0, echo 8→5, fabricated answers 12→15. Trajectory AUROC 0.915 → 0.975.
Data. Report: https://tetracta-model-xray-sample-reports.static.hf.space/reports/karsilastirma-qwen3-8b-base-qwen3-8b.html
Signed provenance/deletion attestation (its report_sha256 pins that exact file): https://www.tetracta.ai/llm_tomografi/attest/219f3e80f1734086a7ac3b8098acf7e8
Machine-readable per-station profiles for this and 21 other interventions across six families: https://huggingface.co/datasets/tetracta/model-xray-gallery
If this does not match how the instruction tuning was actually done, we would genuinely like to know. The instrument is young, family differences like this are exactly what we cannot yet explain, and a correction from the people who trained the model is worth more to us than another scan.
BUYASOUL solves the amnesia problem at the OS layer. We built persistent memory (Scribe + Seshat) + PLT governance + 34-chamber state machine on a 2013 PC. Zero cloud. Canonical: https://huggingface.co/grandcodepope/buyasoul-family