Text Generation
Transformers
Safetensors
English
qwen3_5
image-text-to-text
kozu
reasoning
chain-of-thought
instruction-following
sft
fable
mythos
conversational
Instructions to use Michael-Kozu/Deimos-R1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Michael-Kozu/Deimos-R1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Michael-Kozu/Deimos-R1") 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("Michael-Kozu/Deimos-R1") model = AutoModelForMultimodalLM.from_pretrained("Michael-Kozu/Deimos-R1", 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 Michael-Kozu/Deimos-R1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Michael-Kozu/Deimos-R1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Michael-Kozu/Deimos-R1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Michael-Kozu/Deimos-R1
- SGLang
How to use Michael-Kozu/Deimos-R1 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 "Michael-Kozu/Deimos-R1" \ --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": "Michael-Kozu/Deimos-R1", "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 "Michael-Kozu/Deimos-R1" \ --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": "Michael-Kozu/Deimos-R1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Michael-Kozu/Deimos-R1 with Docker Model Runner:
docker model run hf.co/Michael-Kozu/Deimos-R1
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: Qwen/Qwen3.5-4B
|
| 4 |
+
library_name: transformers
|
| 5 |
+
pipeline_tag: text-generation
|
| 6 |
+
tags:
|
| 7 |
+
- reasoning
|
| 8 |
+
- chain-of-thought
|
| 9 |
+
- instruction-following
|
| 10 |
+
- qwen3_5
|
| 11 |
+
- sft
|
| 12 |
+
language:
|
| 13 |
+
- en
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# Deimos R1
|
| 17 |
+
|
| 18 |
+
**Deimos R1** is a 4B reasoning + instruction-following model by Kozu AI β a QLoRA fine-tune of
|
| 19 |
+
[`Qwen/Qwen3.5-4B`](https://huggingface.co/Qwen/Qwen3.5-4B) on **kozu_reasoning_v1.1**, a
|
| 20 |
+
10k-example blend of derivation-verified reasoning traces and human-authored instruction data.
|
| 21 |
+
The result: **large gains in math reasoning and general knowledge extraction with instruction-
|
| 22 |
+
following improved, not traded away** β from a single epoch (~3 GPU-hours on one GB10).
|
| 23 |
+
|
| 24 |
+
## Benchmarks
|
| 25 |
+
|
| 26 |
+
External suite (lm-eval 0.4.12; identical protocol for base and fine-tune: chat template applied,
|
| 27 |
+
few-shot as multi-turn, 4,096-token generation budget, seed 42, gsm8k/IFEval n=150, MMLU-Pro
|
| 28 |
+
25/subtask β absolute values are protocol-dependent; the **deltas** are the signal):
|
| 29 |
+
|
| 30 |
+
| Benchmark | Qwen3.5-4B (base) | **Deimos R1** | Ξ |
|
| 31 |
+
|---|---|---|---|
|
| 32 |
+
| gsm8k (flexible-extract) | 0.660 | **0.933** | **+0.273** |
|
| 33 |
+
| MMLU-Pro (custom-extract) | 0.394 | **0.634** | **+0.240** |
|
| 34 |
+
| IFEval prompt-strict | 0.247 | **0.320** | +0.073 |
|
| 35 |
+
| IFEval prompt-loose | 0.260 | **0.347** | +0.087 |
|
| 36 |
+
| IFEval inst-strict | 0.433 | **0.479** | +0.046 |
|
| 37 |
+
| IFEval inst-loose | 0.441 | **0.500** | +0.059 |
|
| 38 |
+
| gsm8k (strict `####` match) | 0.673 | 0.233 | β0.440 * |
|
| 39 |
+
|
| 40 |
+
\* The one honest regression, and a narrow one: gsm8k-strict rewards *imitating the few-shot
|
| 41 |
+
examples' `#### N` ending* (no explicit instruction is given). SFT gives the model a confident
|
| 42 |
+
answer style that overrides silent example-imitation. Capability is unaffected (0.933 flexible on
|
| 43 |
+
the same outputs) and **instructed** format-following improved across the board (IFEval β, MMLU-Pro
|
| 44 |
+
extraction β). See "Format adherence" below.
|
| 45 |
+
|
| 46 |
+
Internal harness (held-out, contamination-filtered math problems with verified ground truth, n=200):
|
| 47 |
+
reasoning accuracy **0.175 β 0.465 (2.7Γ)**; IF checks held at 0.917.
|
| 48 |
+
|
| 49 |
+
## Training data
|
| 50 |
+
|
| 51 |
+
**kozu_reasoning_v1.1** (~10k examples, 3-layer QAQC):
|
| 52 |
+
- **Reasoning half (~5k):** step-by-step traces produced by
|
| 53 |
+
[`Kuiper-R1`](https://huggingface.co/Michael-Kozu/Kuiper-R1) (Kozu AI's trace-inversion model)
|
| 54 |
+
by expanding answer-scrubbed skeletons of *human reference solutions* from
|
| 55 |
+
[`openai/gsm8k`](https://huggingface.co/datasets/openai/gsm8k) (MIT) and
|
| 56 |
+
[`AI-MO/NuminaMath-1.5`](https://huggingface.co/datasets/AI-MO/NuminaMath-1.5) (Apache-2.0).
|
| 57 |
+
Every kept trace passed: symbolic (SymPy) answer verification against ground truth, a derivation
|
| 58 |
+
gate (the trace must *derive* the answer β no answer-echo, no upfront leak), deterministic defect
|
| 59 |
+
scans, and an adversarial LLM-judge panel.
|
| 60 |
+
- **Instruction half (~5k):** human-authored pairs used verbatim from
|
| 61 |
+
[`databricks-dolly-15k`](https://huggingface.co/datasets/databricks/databricks-dolly-15k)
|
| 62 |
+
(CC-BY-SA-3.0) and [`OpenAssistant/oasst2`](https://huggingface.co/datasets/OpenAssistant/oasst2)
|
| 63 |
+
(Apache-2.0).
|
| 64 |
+
- **Format-adherence slice (800):** deterministic rewraps of verified rows teaching the model to
|
| 65 |
+
honor an explicitly requested output format (`####`, "the answer is (X)", JSON, `\boxed{}`).
|
| 66 |
+
|
| 67 |
+
Upstream note: Kuiper-R1's base is `empero-ai/Qwythos-9B-Claude-Mythos-5-1M` (Qwen3.5-9B family),
|
| 68 |
+
so the reasoning traces' wording carries that lineage; trace *content* is grounded in human
|
| 69 |
+
reference solutions and answer-verified. No GPT/Claude/Gemini API-harvested datasets and no
|
| 70 |
+
undisclosed-teacher distillation sets were used.
|
| 71 |
+
|
| 72 |
+
## Format adherence
|
| 73 |
+
|
| 74 |
+
Deimos R1 reasons inside `<think>β¦</think>` and then answers. By default the final answer is
|
| 75 |
+
concise; when the prompt **explicitly requests** an output format, the model honors it. It is
|
| 76 |
+
weaker at silently imitating a format that is only *demonstrated* by few-shot examples (the
|
| 77 |
+
gsm8k-strict cell above) β if you need a specific answer format, ask for it in words.
|
| 78 |
+
|
| 79 |
+
## Training
|
| 80 |
+
|
| 81 |
+
QLoRA (r=32, Ξ±=32) via unsloth; 1 epoch over 10,005 examples, max_seq_len 6144, lr 5e-5 cosine,
|
| 82 |
+
effective batch 8; merged to bf16. Single NVIDIA GB10, ~3h wall.
|
| 83 |
+
|
| 84 |
+
## Usage
|
| 85 |
+
|
| 86 |
+
```bash
|
| 87 |
+
vllm serve Michael-Kozu/Deimos-R1 --served-model-name deimos-r1 \
|
| 88 |
+
--max-model-len 8192 --gpu-memory-utilization 0.80 --trust-remote-code
|
| 89 |
+
```
|
| 90 |
+
|
| 91 |
+
Recommended sampling: temperature 0.6β1.0, top_p 0.95. Thinking is on by default (Qwen3.5
|
| 92 |
+
template); the model emits `<think>β¦</think>` then the answer.
|
| 93 |
+
|
| 94 |
+
## Attribution
|
| 95 |
+
|
| 96 |
+
Base: `Qwen/Qwen3.5-4B` (Apache-2.0). Reasoning traces generated with `Kuiper-R1` (Kozu AI).
|
| 97 |
+
Problems/solutions: gsm8k (MIT), NuminaMath-1.5 (Apache-2.0). Instruction data: dolly-15k
|
| 98 |
+
(CC-BY-SA-3.0), oasst2 (Apache-2.0).
|