Instructions to use richmondsin/Qwen3.5-9B-Post-Reasoning with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use richmondsin/Qwen3.5-9B-Post-Reasoning with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="richmondsin/Qwen3.5-9B-Post-Reasoning") 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("richmondsin/Qwen3.5-9B-Post-Reasoning") model = AutoModelForMultimodalLM.from_pretrained("richmondsin/Qwen3.5-9B-Post-Reasoning", 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 richmondsin/Qwen3.5-9B-Post-Reasoning with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "richmondsin/Qwen3.5-9B-Post-Reasoning" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "richmondsin/Qwen3.5-9B-Post-Reasoning", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/richmondsin/Qwen3.5-9B-Post-Reasoning
- SGLang
How to use richmondsin/Qwen3.5-9B-Post-Reasoning 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 "richmondsin/Qwen3.5-9B-Post-Reasoning" \ --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": "richmondsin/Qwen3.5-9B-Post-Reasoning", "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 "richmondsin/Qwen3.5-9B-Post-Reasoning" \ --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": "richmondsin/Qwen3.5-9B-Post-Reasoning", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use richmondsin/Qwen3.5-9B-Post-Reasoning with Docker Model Runner:
docker model run hf.co/richmondsin/Qwen3.5-9B-Post-Reasoning
Qwen3.5-9B-Post-Reasoning
Qwen3.5-9B after supervised Post-Reason tuning, from the paper Post-Reasoning: Improving the Performance of Non-Thinking Models at Negligible Cost (code: https://github.com/richmondsin/Post-Reasoning).
Post-Reasoning asks an instruction-tuned model to state the final answer first and to justify it after the answer. The answer can be read (and generation stopped) at the end-of-answer marker, so no reasoning tokens come before it. Post-Reason tuning trains the model on post-answer justifications only: the loss is masked on the prompt and on the answer.
- Base model: Qwen/Qwen3.5-9B
- Training data: NuminaMath problems with self-distilled post-answer justifications (local data file
post_reflective_data/qwen35_9b_numina_v4.json) - Method: LoRA (r 16, lora_alpha 32, dropout 0.05), learning rate 2e-5, 3 epochs, cosine schedule, then merged into the base weights (bf16)
- Local checkpoint name:
Qwen35-9B-numina-Reflection-Merged-v4
Usage (vLLM)
from vllm import LLM, SamplingParams
llm = LLM(model="richmondsin/Qwen3.5-9B-Post-Reasoning")
prompt = "What is 10 + 2? State the final answer immediately and justify your answer."
out = llm.chat([{"role": "user", "content": prompt}], SamplingParams(temperature=0, max_tokens=512))
print(out[0].outputs[0].text) # "Answer: 12. Explanation: ..."
To read only the answer, stop generation at the end-of-answer marker (for example stop=["Explanation"]).
The evaluation prompts and scripts are in the GitHub repository.
Citation
@article{sin2026postreasoning,
title = {Post-Reasoning: Improving the Performance of Non-Thinking Models at Negligible Cost},
author = {Sin, Richmond Jing Xuan and Bhardwaj, Rishabh and Poria, Soujanya},
journal = {arXiv preprint arXiv:2605.06165},
year = {2026}
}
The use of this model follows the license of the base model (apache-2.0).
- Downloads last month
- 297