gabriellarson commited on
Commit
d724815
·
verified ·
1 Parent(s): 0b53c12

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +209 -0
README.md ADDED
@@ -0,0 +1,209 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ license: apache-2.0
5
+ tags:
6
+ - Qwen-3-14B
7
+ - instruct
8
+ - finetune
9
+ - reasoning
10
+ - hybrid-mode
11
+ - chatml
12
+ - function calling
13
+ - tool use
14
+ - json mode
15
+ - structured outputs
16
+ - atropos
17
+ - dataforge
18
+ - long context
19
+ - roleplaying
20
+ - chat
21
+ base_model:
22
+ - NousResearch/Hermes-4-14B
23
+ library_name: transformers
24
+ widget:
25
+ - example_title: Hermes 4
26
+ messages:
27
+ - role: system
28
+ content: >-
29
+ You are Hermes 4, a capable, neutrally-aligned assistant. Prefer concise,
30
+ correct answers.
31
+ - role: user
32
+ content: Explain the difference between BFS and DFS to a new CS student.
33
+ model-index:
34
+ - name: Hermes-4-Qwen-3-14B
35
+ results: []
36
+ ---
37
+ # Hermes 4 — Qwen 3 14B
38
+
39
+ ![image/jpeg](https://cdn-uploads.huggingface.co/production/uploads/6317aade83d8d2fd903192d9/roT9o5bMYBtQziRMlaSDf.jpeg)
40
+
41
+ ## Model Description
42
+
43
+ Hermes 4 14B is a frontier, hybrid-mode **reasoning** model based on Qwen 3 14B by Nous Research that is aligned to **you**.
44
+
45
+ Read the Hermes 4 technical report here: <a href="https://arxiv.org/abs/2508.18255">Hermes 4 Technical Report</a>
46
+
47
+ Chat with Hermes in Nous Chat: https://chat.nousresearch.com
48
+
49
+ Training highlights include a newly synthesized post-training corpus emphasizing verified reasoning traces, massive improvements in math, code, STEM, logic, creativity, and format-faithful outputs, while preserving general assistant quality and broadly neutral alignment.
50
+
51
+
52
+ ## What’s new vs Hermes 3
53
+
54
+ - **Post-training corpus**: Massively increased dataset size from 1M samples and 1.2B tokens to **~5M samples / ~60B tokens** blended across reasoning and non-reasoning data.
55
+ - **Hybrid reasoning mode** with explicit `<think>…</think>` segments when the model decides to deliberate, and options to make your responses faster when you want.
56
+ - **Reasoning** that is top quality, expressive, improves math, code, STEM, logic, and even creative writing and subjective responses.
57
+ - **Schema adherence & structured outputs**: trained to produce valid JSON for given schemas and to repair malformed objects.
58
+ - **Much easier to steer and align**: extreme improvements on steerability, especially on reduced refusal rates.
59
+
60
+ ## Our Mission: Frontier Capabilities Aligned to You
61
+
62
+ In pursuit of the mission of producing models that are open, steerable and capable of producing the full range of human expression, while being able to be aligned to your values, we created a new benchmark, RefusalBench, that tests the models willingness to be helpful in a variety of scenarios commonly disallowed by closed and open models.
63
+
64
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6317aade83d8d2fd903192d9/t_HvRYPEHV0pc8iS2zHHn.png)
65
+
66
+ Hermes 4 achieves SOTA on RefusalBench across all popular closed and open models in being helpful and conforming to your values, without censorship.
67
+
68
+ ## Benchmarks (Hermes 4 14B)
69
+
70
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6317aade83d8d2fd903192d9/Sa-X7ErRF0ej20P8qBv9i.png)
71
+
72
+ > Full tables, settings, and comparisons are in the technical report.
73
+
74
+ ## Prompt Format
75
+
76
+ Hermes 4 uses ChatML format with role headers and special tags.
77
+
78
+ **Basic chat:**
79
+ ```
80
+ <|im_start|>system
81
+ You are Hermes 4. Be concise and helpful.<|im_end|>
82
+ <|im_start|>user
83
+ Explain the photoelectric effect simply.<|im_end|>
84
+ <|im_start|>assistant
85
+ ```
86
+
87
+ ### Reasoning mode
88
+
89
+ Reasoning mode can be activated with the chat template via the flag `thinking=True` or by using the following system prompt:
90
+
91
+ ```
92
+ You are a deep thinking AI, you may use extremely long chains of thought to deeply consider the problem and deliberate with yourself via systematic reasoning processes to help come to a correct solution prior to answering. You should enclose your thoughts and internal monologue inside <think> </think> tags, and then provide your solution or response to the problem.
93
+ ```
94
+
95
+ Note that you can add any additional system instructions before or after this system message, and it will adjust the models policies, style, and effort of thinking, as well as its post-thinking style, format, identity, and more. You may also interleave the tool definition system message with the reasoning one.
96
+
97
+ When the model chooses to deliberate, it emits:
98
+
99
+ ```
100
+ <|im_start|>assistant
101
+ <think>
102
+ …model’s internal reasoning may appear here…
103
+ </think>
104
+ Final response starts here…<|im_end|>
105
+ ```
106
+
107
+ Additionally, we provide a flag to keep the content inbetween the `<think> ... </think>` that you can play with by setting `keep_cots=True`
108
+
109
+
110
+ ## Function Calling & Tool Use
111
+
112
+ Hermes 4 supports function/tool calls *within* a single assistant turn, produced after it's reasoning:
113
+
114
+ **System message (example):**
115
+
116
+ ```
117
+ <|im_start|>system
118
+ You are a function-calling AI. Tools are provided inside <tools>…</tools>.
119
+ When appropriate, call a tool by emitting a <tool_call>{...}</tool_call> object.
120
+ After a tool responds (as <tool_response>), continue reasoning inside <think> and produce the final answer.
121
+ <tools>
122
+ {"type":"function","function":{"name":"get_weather","description":"Get weather by city","parameters":{"type":"object","properties":{"city":{"type":"string"}},"required":["city"]}}}
123
+ </tools><|im_end|>
124
+ ```
125
+
126
+ Note that you may also simply place tool definitions into the "tools:" field of your messages, and the chat template will parse and create the system prompt for you. This also works with reasoning mode for improved accuracy of tool use.
127
+
128
+ The model will then generate tool calls within `<tool_call> {tool_call} </tool_call>` tags, for easy parsing. The tool_call tags are also added tokens, so it makes it easy to parse while streaming! There are also automatic tool parsers built-in to VLLM and SGLang for Hermes, just set the tool parser in VLLM to `hermes` and in SGLang to `qwen25`.
129
+ ## Inference Notes
130
+ - **Sampling defaults that work well:** `temperature=0.6, top_p=0.95, top_k=20`.
131
+ - **Template:** Use the ChatML chat format for Hermes 4 14B as shown above, or set `add_generation_prompt=True` when using `tokenizer.apply_chat_template(...)`.
132
+ ### Transformers example
133
+ ```python
134
+ from transformers import AutoTokenizer, AutoModelForCausalLM
135
+ import torch
136
+ model_id = "NousResearch/Hermes-4-14B"
137
+
138
+ tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
139
+ model = AutoModelForCausalLM.from_pretrained(
140
+ model_id,
141
+ torch_dtype=torch.float16,
142
+ device_map="auto"
143
+ )
144
+ messages = [
145
+ {"role":"system","content":"You are Hermes 4. Be concise."},
146
+ {"role":"user","content":"Summarize CRISPR in 3 sentences."}
147
+ ]
148
+ inputs = tokenizer.apply_chat_template(
149
+ messages, add_generation_prompt=True, return_tensors="pt"
150
+ ).to(model.device)
151
+ outputs = model.generate(
152
+ **inputs, max_new_tokens=400, temperature=0.6, top_p=0.95, top_k=20, do_sample=True
153
+ )
154
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
155
+ ```
156
+ For production serving on multi-GPU nodes, consider tensor parallel inference engines (e.g., SGLang/vLLM backends) with prefix caching.
157
+
158
+ ## Inference Providers:
159
+
160
+ ### Nous Portal:
161
+
162
+ <a href="https://portal.nousresearch.com"><img width=256 alt="chutes logo" src="https://cdn-uploads.huggingface.co/production/uploads/6317aade83d8d2fd903192d9/6YytY7N0mjCnBQvWo3qtv.png"></a>
163
+
164
+ ### Chutes:
165
+
166
+ <a href="https://chutes.ai/app"><img width=256 alt="chutes logo" src="https://cdn-uploads.huggingface.co/production/uploads/6317aade83d8d2fd903192d9/l14AWPv6cSvaprpwK_IWY.png"></a>
167
+
168
+ ### Nebius:
169
+
170
+ <a href="https://nebius.com/services/studio-inference-service">
171
+ <picture>
172
+ <source media="(prefers-color-scheme: dark)" srcset="https://cdn-uploads.huggingface.co/production/uploads/6317aade83d8d2fd903192d9/vhL0oAomFa_awBdt2KF_x.png">
173
+ <source media="(prefers-color-scheme: light)" srcset="https://cdn-uploads.huggingface.co/production/uploads/64b21cbb2fc8324fcb1dac03/LjAfeFfAz8ac5rV-iiwj5.png">
174
+ <img width=256 alt="nebius.com logo" src="https://cdn-uploads.huggingface.co/production/uploads/64b21cbb2fc8324fcb1dac03/LjAfeFfAz8ac5rV-iiwj5.png">
175
+ </picture>
176
+ </a>
177
+
178
+ ### Luminal:
179
+
180
+ <a href="https://luminalai.com/">
181
+ <img width=256 alt="luminal logo" src="https://cdn-uploads.huggingface.co/production/uploads/6317aade83d8d2fd903192d9/FIHsRdjMMP0HUjebiuJyH.png">
182
+ </a>
183
+
184
+ # Quantized / Smaller Variants
185
+
186
+ Hermes 4 is available as BF16 original weights as well as BF16 as well as FP8 variants and GGUF variants by LM Studio.
187
+
188
+ FP8: https://huggingface.co/NousResearch/Hermes-4-14B-FP8
189
+
190
+ GGUF (Courtesy of LM Studio team!):
191
+
192
+ Hermes 4 is also available in larger sizes (e.g., 70B, 405B) with similar prompt formats.
193
+
194
+ See the Hermes 4 collection to explore them all:
195
+ https://huggingface.co/collections/NousResearch/hermes-4-collection-68a731bfd452e20816725728
196
+
197
+ # How to cite
198
+
199
+ ```bibtex
200
+ @misc{teknium2025hermes4technicalreport,
201
+ title={Hermes 4 Technical Report},
202
+ author={Ryan Teknium and Roger Jin and Jai Suphavadeeprasit and Dakota Mahan and Jeffrey Quesnelle and Joe Li and Chen Guang and Shannon Sands and Karan Malhotra},
203
+ year={2025},
204
+ eprint={2508.18255},
205
+ archivePrefix={arXiv},
206
+ primaryClass={cs.AI},
207
+ url={https://arxiv.org/abs/2508.18255},
208
+ }
209
+ ```