khazarai/qwen3.6-plus-high-reasoning-500x
Viewer • Updated • 500 • 1.74k • 16
How to use khazarai/Qwen3.5-2B-Qwen3.6-plus-Distilled with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("image-text-to-text", model="khazarai/Qwen3.5-2B-Qwen3.6-plus-Distilled")
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) # Load model directly
from transformers import AutoProcessor, AutoModelForMultimodalLM
processor = AutoProcessor.from_pretrained("khazarai/Qwen3.5-2B-Qwen3.6-plus-Distilled")
model = AutoModelForMultimodalLM.from_pretrained("khazarai/Qwen3.5-2B-Qwen3.6-plus-Distilled", 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=40)
print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:]))How to use khazarai/Qwen3.5-2B-Qwen3.6-plus-Distilled with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "khazarai/Qwen3.5-2B-Qwen3.6-plus-Distilled"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "khazarai/Qwen3.5-2B-Qwen3.6-plus-Distilled",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image in one sentence."
},
{
"type": "image_url",
"image_url": {
"url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg"
}
}
]
}
]
}'docker model run hf.co/khazarai/Qwen3.5-2B-Qwen3.6-plus-Distilled
How to use khazarai/Qwen3.5-2B-Qwen3.6-plus-Distilled with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "khazarai/Qwen3.5-2B-Qwen3.6-plus-Distilled" \
--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": "khazarai/Qwen3.5-2B-Qwen3.6-plus-Distilled",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image in one sentence."
},
{
"type": "image_url",
"image_url": {
"url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg"
}
}
]
}
]
}'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 "khazarai/Qwen3.5-2B-Qwen3.6-plus-Distilled" \
--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": "khazarai/Qwen3.5-2B-Qwen3.6-plus-Distilled",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image in one sentence."
},
{
"type": "image_url",
"image_url": {
"url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg"
}
}
]
}
]
}'How to use khazarai/Qwen3.5-2B-Qwen3.6-plus-Distilled with Unsloth Studio:
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for khazarai/Qwen3.5-2B-Qwen3.6-plus-Distilled to start chatting
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for khazarai/Qwen3.5-2B-Qwen3.6-plus-Distilled to start chatting
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for khazarai/Qwen3.5-2B-Qwen3.6-plus-Distilled to start chatting
pip install unsloth
from unsloth import FastModel
model, tokenizer = FastModel.from_pretrained(
model_name="khazarai/Qwen3.5-2B-Qwen3.6-plus-Distilled",
max_seq_length=2048,
)How to use khazarai/Qwen3.5-2B-Qwen3.6-plus-Distilled with Docker Model Runner:
docker model run hf.co/khazarai/Qwen3.5-2B-Qwen3.6-plus-Distilled
irm https://unsloth.ai/install.ps1 | iex
# Run unsloth studio
unsloth studio -H 0.0.0.0 -p 8888
# Then open http://localhost:8888 in your browser
# Search for khazarai/Qwen3.5-2B-Qwen3.6-plus-Distilled to start chatting# No setup required# Open https://huggingface.co/spaces/unsloth/studio in your browser
# Search for khazarai/Qwen3.5-2B-Qwen3.6-plus-Distilled to start chattingpip install unsloth
from unsloth import FastModel
model, tokenizer = FastModel.from_pretrained(
model_name="khazarai/Qwen3.5-2B-Qwen3.6-plus-Distilled",
max_seq_length=2048,
)This model is a distilled reasoning-enhanced variant of Qwen3.5-2B, designed to improve:
The model is trained via distillation from a stronger reasoning model (Qwen3.6-plus), transferring:
Compared to the base model, this model:
The base model often exhibits:
This distilled model:
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("khazarai/Qwen3.5-2B-Qwen3.6-plus-Distilled")
model = AutoModelForCausalLM.from_pretrained(
"khazarai/Qwen3.5-2B-Qwen3.6-plus-Distilled",
device_map={"": 0}
)
question = """
An 8-year-old boy is brought to the pediatrician by his mother with nausea, vomiting, and decreased frequency of urination. He has acute lymphoblastic leukemia for which he received the 1st dose of chemotherapy 5 days ago. His leukocyte count was 60,000/mm3 before starting chemotherapy. The vital signs include: pulse 110/min, temperature 37.0°C (98.6°F), and blood pressure 100/70 mm Hg. The physical examination shows bilateral pedal edema. Which of the following serum studies and urinalysis findings will be helpful in confirming the diagnosis of this condition? ?
{'A': 'Hyperkalemia, hyperphosphatemia, hypocalcemia, and extremely elevated creatine kinase (MM)', 'B': 'Hyperkalemia, hyperphosphatemia, hypocalcemia, hyperuricemia, urine supernatant pink, and positive for heme', 'C': 'Hyperuricemia, hyperkalemia, hyperphosphatemia, lactic acidosis, and urate crystals in the urine', 'D': 'Hyperuricemia, hyperkalemia, hyperphosphatemia, and urinary monoclonal spike', 'E': 'Hyperuricemia, hyperkalemia, hyperphosphatemia, lactic acidosis, and oxalate crystals'}
"""
messages = [
{
"role": "user",
"content": [
{"type": "text", "text": question}
]
},
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
enable_thinking = True,
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=2048, do_sample = True, top_p=0.95, top_k=20, temperature=1.0, min_p=0.0, repetition_penalty=1.0)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))
Install Unsloth Studio (macOS, Linux, WSL)
# Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for khazarai/Qwen3.5-2B-Qwen3.6-plus-Distilled to start chatting