Instructions to use laion/qwen3-30b-a3b-thinking-opencode-sft-sparse with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use laion/qwen3-30b-a3b-thinking-opencode-sft-sparse with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="laion/qwen3-30b-a3b-thinking-opencode-sft-sparse") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("laion/qwen3-30b-a3b-thinking-opencode-sft-sparse") model = AutoModelForCausalLM.from_pretrained("laion/qwen3-30b-a3b-thinking-opencode-sft-sparse", 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use laion/qwen3-30b-a3b-thinking-opencode-sft-sparse with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "laion/qwen3-30b-a3b-thinking-opencode-sft-sparse" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "laion/qwen3-30b-a3b-thinking-opencode-sft-sparse", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/laion/qwen3-30b-a3b-thinking-opencode-sft-sparse
- SGLang
How to use laion/qwen3-30b-a3b-thinking-opencode-sft-sparse 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 "laion/qwen3-30b-a3b-thinking-opencode-sft-sparse" \ --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": "laion/qwen3-30b-a3b-thinking-opencode-sft-sparse", "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 "laion/qwen3-30b-a3b-thinking-opencode-sft-sparse" \ --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": "laion/qwen3-30b-a3b-thinking-opencode-sft-sparse", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use laion/qwen3-30b-a3b-thinking-opencode-sft-sparse with Docker Model Runner:
docker model run hf.co/laion/qwen3-30b-a3b-thinking-opencode-sft-sparse
| library_name: transformers | |
| tags: | |
| - generated_from_trainer | |
| model-index: | |
| - name: mnt/home/bf996/experiments/densemixer/run2_sparse_out | |
| results: [] | |
| <!-- This model card has been generated automatically according to the information the Trainer had access to. You | |
| should probably proofread and complete it, then remove this comment. --> | |
| [<img src="https://raw.githubusercontent.com/axolotl-ai-cloud/axolotl/main/image/axolotl-badge-web.png" alt="Built with Axolotl" width="200" height="32"/>](https://github.com/axolotl-ai-cloud/axolotl) | |
| <details><summary>See axolotl config</summary> | |
| axolotl version: `0.17.0.dev0` | |
| ```yaml | |
| # axolotl SFT — Run 2 (DenseMixer OFF = native sparse) — Qwen3-30B-A3B-Thinking-2507 on opencode traces. | |
| # Experiment: axolotl-sft-opencode-densemoe (task #16). The CONTROL arm of the paired ablation: | |
| # BYTE-IDENTICAL to Run 1 (densemixer_run1_opencode.yaml) EXCEPT `dense_mixer: false` + `output_dir`. | |
| # Control discipline (POLICY §2): SAME θ₀, seed, dataset + data-ORDER (same shared prepared path), | |
| # seq_len, batch, packing, LR schedule, step count — the ONLY functional diff is dense_mixer true→false | |
| # (plugin stays loaded; with false its pre_model_load is a no-op → stock sparse top-k MoE forward). | |
| # Design/rationale: experiments/active/axolotl-sft-opencode-densemoe/{POLICY,STATE}.md. | |
| # | |
| # ⚠ LAUNCH PATH = DIRECT `axolotl.cli.train` (NOT hpc.launch — it would strip plugins/dense_mixer/fp8). | |
| # ⚠ REQUIRES image `mega_final_dm.sqsh` (densemixer==1.0.1 + the tf-5.x port baked in). | |
| # θ₀ — the SHARED init both runs start from (control discipline). IDENTICAL to Run 1. | |
| base_model: /mnt/home/bf996/experiments/densemixer/theta0 # Qwen/Qwen3-30B-A3B-Thinking-2507 @ 144afc2f... | |
| model_type: AutoModelForCausalLM | |
| trust_remote_code: true | |
| # === THE one-flag control diff: DenseMixer OFF === | |
| # Plugin stays in the stack (identical to Run 1); `dense_mixer: false` makes its pre_model_load a | |
| # no-op → the model keeps the STOCK sparse top-k Qwen3MoE forward (non-selected experts' router | |
| # logits get zero task-loss gradient). This is the sparse baseline for the Δθ counterfactual. | |
| plugins: | |
| - axolotl.integrations.densemixer.DenseMixerPlugin | |
| dense_mixer: false # Run 2 = OFF (the ONLY functional diff vs Run 1). | |
| # opencode SFT dataset — IDENTICAL pinned revision + SHARED prepared path (guarantees same data ORDER). | |
| datasets: | |
| - path: /mnt/home/bf996/experiments/densemixer/data_nemotron_code_oracle | |
| ds_type: parquet | |
| data_files: | |
| - /mnt/home/bf996/experiments/densemixer/data_nemotron_code_oracle/data/train-*.parquet | |
| type: chat_template | |
| field_messages: conversations | |
| message_property_mappings: | |
| role: role | |
| content: content | |
| split_thinking: false | |
| chat_template: chatml | |
| dataset_prepared_path: /mnt/home/bf996/experiments/densemixer/prepared/run1 # SHARED with Run 1 (same tokens + order) | |
| val_set_size: 0.0 | |
| dataset_num_proc: 1 | |
| dataloader_num_workers: 2 | |
| dataloader_prefetch_factor: 2 | |
| # === precision — bf16 + flash-attn (IDENTICAL to Run 1) === | |
| bf16: true | |
| fp16: false | |
| fp8: false # ⚠ MANDATORY EXPLICIT — axolotl 0.17 auto-enables fp8 on sm_100 → nan. | |
| tf32: false | |
| attn_implementation: flash_attention_2 | |
| # === memory / compute (IDENTICAL to Run 1) === | |
| # ⚠ Blackwell fix (B-only, functionally inert for A): the STOCK Qwen3MoE experts default to the | |
| # `grouped_mm` kernel -> `torch._grouped_mm`, which is Hopper-only (cc 9.0) and RuntimeErrors on the | |
| # B200 (cc 10.0) at the first step (job 31707). `eager` uses the per-expert F.linear loop (no | |
| # grouped_mm) -> works on Blackwell. This is NOT a control confound: A (dense_mixer:true) replaces the | |
| # whole SparseMoeBlock.forward with the tf-5.x port that accesses expert weights directly and NEVER | |
| # calls self.experts.forward, so `experts_implementation` is never exercised on A's path — the only | |
| # FUNCTIONAL A/B difference remains dense (all-expert STE) vs sparse (top-k). Both do per-expert F.linear. | |
| experts_implementation: eager | |
| deepspeed: /opt/axolotl/deepspeed_configs/zero3_bf16.json | |
| gradient_checkpointing: true | |
| chunked_cross_entropy: true | |
| sequence_len: 16384 | |
| sample_packing: true | |
| # === control discipline — IDENTICAL to Run 1 === | |
| seed: 42 | |
| micro_batch_size: 1 | |
| gradient_accumulation_steps: 4 | |
| num_epochs: 3.0 | |
| learning_rate: 2.0e-5 | |
| lr_scheduler: cosine | |
| warmup_ratio: 0.1 | |
| max_grad_norm: 1.0 | |
| optimizer: adamw_torch_fused | |
| weight_decay: 0.0 | |
| # === checkpoint cadence (IDENTICAL to Run 1) — θ₀ + intermediate + final for the Δθ trajectory === | |
| logging_steps: 1 | |
| save_steps: 10 | |
| save_total_limit: 100 | |
| output_dir: /mnt/home/bf996/experiments/densemixer/run2_sparse_out # DISTINCT from Run 1 (not a control var) | |
| special_tokens: {} | |
| ``` | |
| </details><br> | |
| # mnt/home/bf996/experiments/densemixer/run2_sparse_out | |
| This model was trained from scratch on the None dataset. | |
| ## Model description | |
| More information needed | |
| ## Intended uses & limitations | |
| More information needed | |
| ## Training and evaluation data | |
| More information needed | |
| ## Training procedure | |
| ### Training hyperparameters | |
| The following hyperparameters were used during training: | |
| - learning_rate: 2e-05 | |
| - train_batch_size: 1 | |
| - eval_batch_size: 1 | |
| - seed: 42 | |
| - distributed_type: multi-GPU | |
| - num_devices: 8 | |
| - gradient_accumulation_steps: 4 | |
| - total_train_batch_size: 32 | |
| - total_eval_batch_size: 8 | |
| - optimizer: Use OptimizerNames.ADAMW_TORCH_FUSED with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments | |
| - lr_scheduler_type: cosine | |
| - lr_scheduler_warmup_steps: 9 | |
| - training_steps: 96 | |
| ### Training results | |
| ### Framework versions | |
| - Transformers 5.12.1 | |
| - Pytorch 2.8.0a0+5228986c39.nv25.06 | |
| - Datasets 4.8.5 | |
| - Tokenizers 0.23.0-rc0 | |