Instructions to use khazarai/Qwen3.8-max-Reasoning-Distilled with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use khazarai/Qwen3.8-max-Reasoning-Distilled with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="khazarai/Qwen3.8-max-Reasoning-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.8-max-Reasoning-Distilled") model = AutoModelForMultimodalLM.from_pretrained("khazarai/Qwen3.8-max-Reasoning-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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use khazarai/Qwen3.8-max-Reasoning-Distilled with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "khazarai/Qwen3.8-max-Reasoning-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.8-max-Reasoning-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" } } ] } ] }'Use Docker
docker model run hf.co/khazarai/Qwen3.8-max-Reasoning-Distilled
- SGLang
How to use khazarai/Qwen3.8-max-Reasoning-Distilled 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 "khazarai/Qwen3.8-max-Reasoning-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.8-max-Reasoning-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" } } ] } ] }'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 "khazarai/Qwen3.8-max-Reasoning-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.8-max-Reasoning-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" } } ] } ] }' - Unsloth Desktop
- Docker Model Runner
How to use khazarai/Qwen3.8-max-Reasoning-Distilled with Docker Model Runner:
docker model run hf.co/khazarai/Qwen3.8-max-Reasoning-Distilled
Qwen3.8-max-Reasoning-Distilled
Qwen3.8-max-Reasoning-Distilled is a compact, high-efficiency language model fine-tuned using Knowledge Distillation from Qwen3.8-max.
It specifically addresses the common issue of overthinking loops and repetitive hesitations found in smaller raw reasoning models. By learning directly from high-quality reasoning traces, this model delivers concise, structured, and decisive Chain-of-Thought (CoT) outputs without wasting tokens on circular verification.
Key Features
Streamlined Chain-of-Thought (CoT): Replaces verbose, rambling reasoning paths with direct, step-by-step logic.
Elimination of Overthinking: Suppresses repetitive inner monologue loops (e.g., "Wait, let me re-verify...") that consume unnecessary tokens.
Higher Inference Efficiency: Drastically reduces total generated token count while maintaining or improving final answer accuracy.
Distilled Logic from Qwen3.8-max: Captures the complex evaluation heuristics of the teacher model into a smaller, faster student architecture.
Reasoning Quality Comparison
Below is a comparison highlighting how distillation improves reasoning structure and eliminates repetitive loops:
| Feature | Qwen3.5-0.8B | Qwen3.8-max-Reasoning-Distilled |
|---|---|---|
| Logic Flow | Frequent self-doubt, circular checks, hesitation | Linear, structured, and hypothesis-driven |
| Token Economy | High token overhead spent on repetitive verification | Low token overhead with concise step evaluation |
| Option Analysis | Reiterates choices multiple times without deciding | Evaluates each option once with clear justification |
| Decision Speed | Slow convergence to final answer | Fast, decisive output generation |
Example Trace
Task: Identify the beneficial effect of carpooling from multiple choice options.
- Qwen3.5-0.8B: "Evaluate option D... wait, let me check option E... actually, let me re-evaluate D... wait, is there a trick? Let me double-check..." (Overthinking Loop)
- Qwen3.8-max-Reasoning-Distilled: "Systematically evaluates choices A through H in a single pass $\rightarrow$ identifies option D as the primary environmental benefit $\rightarrow$ concludes decisively." (Clean & Direct)
Limitations
While the model minimizes overthinking, extremely complex multi-step mathematical problems may still require prompting for explicit scratchpad steps. Always verify outputs when using the model for domain-critical tasks (e.g., medical, legal, or financial decisions).
- Downloads last month
- -