Instructions to use amayuelas/Qwen3.5-9B-MatRL-MT-SFT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use amayuelas/Qwen3.5-9B-MatRL-MT-SFT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="amayuelas/Qwen3.5-9B-MatRL-MT-SFT") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("amayuelas/Qwen3.5-9B-MatRL-MT-SFT") model = AutoModelForMultimodalLM.from_pretrained("amayuelas/Qwen3.5-9B-MatRL-MT-SFT", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use amayuelas/Qwen3.5-9B-MatRL-MT-SFT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "amayuelas/Qwen3.5-9B-MatRL-MT-SFT" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "amayuelas/Qwen3.5-9B-MatRL-MT-SFT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/amayuelas/Qwen3.5-9B-MatRL-MT-SFT
- SGLang
How to use amayuelas/Qwen3.5-9B-MatRL-MT-SFT 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 "amayuelas/Qwen3.5-9B-MatRL-MT-SFT" \ --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": "amayuelas/Qwen3.5-9B-MatRL-MT-SFT", "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 "amayuelas/Qwen3.5-9B-MatRL-MT-SFT" \ --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": "amayuelas/Qwen3.5-9B-MatRL-MT-SFT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use amayuelas/Qwen3.5-9B-MatRL-MT-SFT with Docker Model Runner:
docker model run hf.co/amayuelas/Qwen3.5-9B-MatRL-MT-SFT
Qwen3.5-9B — MatRL multi-turn SFT (cold start)
Qwen/Qwen3.5-9B cold-started on
amayuelas/matrl-sft-mt:
1,119 multi-turn tool-use episodes for crystal-structure inverse design.
This is the model-scale arm of
amayuelas/Qwen3.5-4B-MatRL-MT-SFT.
It uses the same corpus, renderer, 3-epoch schedule and loss mask. Only the
model, the parallelism layout and the learning rate differ, so any difference
between the two comes down to scale.
This is the cold-start checkpoint. Its job is format and the tool loop:
propose, evaluate, refine, and above all commit within the turn budget. The
chemistry is learned afterwards by RL; see
amayuelas/Qwen3.5-9B-MatRL-MT-RL.
Why a cold start is needed
Base Qwen3.5 essentially never commits. Across 2,880 multi-turn rollouts the 4B
base model made 3 submit calls. It proposes prolifically (~5.6
candidates/rollout), evaluates sparingly, then runs out of turns. Strict
multi-turn SUN is therefore 0% by construction: a commitment failure, not a
chemistry failure. This stage teaches the agent to close an episode.
Training
| base | Qwen/Qwen3.5-9B |
| data | 1,119 of the dataset's 1,123 episodes, assistant-only loss |
| steps | 420 (3 epochs), global batch 8 |
| seq len | 16,384 |
| optimizer | AdamW, lr 1e-5, constant, no warmup (half the 4B's 2e-5) |
| precision | bf16 |
| parallelism | FSDP over 8 ranks + context parallel (cp=4, ulysses) |
| trainer | prime-rl |
Trained on 8×A100-40GB. Loss fell from 1.21 at the first step to ~0.8 over the final epoch.
Four episodes (3 band-gap, 1 formula) are longer than 16,384 tokens once rendered with the Qwen3.5 chat template, so they were dropped instead of truncated.
Context parallelism uses ulysses, not ring: Qwen3.5 is a hybrid with linear attention (DeltaNet) layers, and ring attention is a softmax-attention algorithm that does not apply to them.
Evaluation
This checkpoint has not yet been scored on the SUN benchmark used for the 4B release.
Important: thinking channel
This model is trained with reasoning in the native thinking channel
(reasoning_content → <think>), preserved across tool calls. Do not
evaluate it with enable_thinking=false, which turns off the very behavior
this run trains.
Serving
Qwen3.5 is a VL-capable model class, so vLLM requires an image-processor config
even for text-only serving. preprocessor_config.json and
video_preprocessor_config.json are included; without them vLLM fails on load.
- Downloads last month
- 10