Instructions to use Qwen/Qwen3-30B-A3B-Instruct-2507 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Qwen/Qwen3-30B-A3B-Instruct-2507 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Qwen/Qwen3-30B-A3B-Instruct-2507") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen3-30B-A3B-Instruct-2507") model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-30B-A3B-Instruct-2507", 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
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Qwen/Qwen3-30B-A3B-Instruct-2507 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Qwen/Qwen3-30B-A3B-Instruct-2507" # 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-30B-A3B-Instruct-2507", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Qwen/Qwen3-30B-A3B-Instruct-2507
- SGLang
How to use Qwen/Qwen3-30B-A3B-Instruct-2507 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-30B-A3B-Instruct-2507" \ --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-30B-A3B-Instruct-2507", "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-30B-A3B-Instruct-2507" \ --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-30B-A3B-Instruct-2507", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Qwen/Qwen3-30B-A3B-Instruct-2507 with Docker Model Runner:
docker model run hf.co/Qwen/Qwen3-30B-A3B-Instruct-2507
Lora Fine Tning- Several Issues
Has anyone successfully trained this model? I have tried several ways including unsloth, Lora, etc. Error after error. Any tips or a training script that works on a L40S-180 would be awesome. Free access to L40S-90, 180, and 360(reasonable access, nothing crazy, you want to fine tune a model or 2, I'm good with that) to anyone that can help.
Quick context:setup 2× NVIDIA L40S on OVH (44 GB each, single node) PyTorch 2.5.1 + cu121 transformers 4.57.2 peft + trl installed from pip this week (can post exact versions if needed)
QLoRA, 4-bit, LoRA rank 32, target_modules:
["q_proj", "k_proj", "v_proj", "o_proj", "gate_proj", "up_proj", "down_proj"] Training on 372 train examples + 93 val examples JSONL, already formatted to chat / SFT style. Model and data load fine, tokenization runs, GPUs spin up, but as soon as the training loop starts it dies cleanly: Progress bar sits at 0/72 then exits nvidia-smi goes back to no python processes, No obvious Python traceback, just the usual warnings about
use_cache=True is incompatible with gradient checkpointing and
torch.utils.checkpoint: use_reentrant should be passed explicitly. Same basic behavior whether I try Unsloth’s SFTTrainer or a plain HF QLoRA trainer. If anyone has a minimal LoRA / QLoRA training script that actually runs on this checkpoint on a single 2×L40S box, I’m happy to adapt it and then share back a cleaned-up version here so others don’t have to fight this.
Seems to be connected to this: https://github.com/pytorch/pytorch/issues/168329
Loads quickly without expert layers - ["up_proj", "down_proj"]
Thanks, I just spun up the latest qwen3.5-122b, its a beast