shimmyshimmer commited on
Commit
328ef18
·
verified ·
1 Parent(s): 257fe9c

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +245 -0
README.md ADDED
@@ -0,0 +1,245 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ license: llama3
5
+ tags:
6
+ - Llama-3.1
7
+ - unsloth
8
+ - instruct
9
+ - finetune
10
+ - reasoning
11
+ - hybrid-mode
12
+ - chatml
13
+ - function calling
14
+ - tool use
15
+ - json mode
16
+ - structured outputs
17
+ - atropos
18
+ - dataforge
19
+ - long context
20
+ - roleplaying
21
+ - chat
22
+ base_model:
23
+ - NousResearch/Hermes-4-70B
24
+ library_name: transformers
25
+ widget:
26
+ - example_title: Hermes 4
27
+ messages:
28
+ - role: system
29
+ content: >-
30
+ You are Hermes 4, a capable, neutrally-aligned assistant. Prefer concise,
31
+ correct answers.
32
+ - role: user
33
+ content: >-
34
+ Explain the difference between BFS and DFS to a new CS student.
35
+ model-index:
36
+ - name: Hermes-4-Llama-3.1-70B
37
+ results: []
38
+ ---
39
+ > [!NOTE]
40
+ > Includes Unsloth **chat template fixes**! <br> For `llama.cpp`, use `--jinja`
41
+ >
42
+
43
+ <div>
44
+ <p style="margin-top: 0;margin-bottom: 0;">
45
+ <em><a href="https://docs.unsloth.ai/basics/unsloth-dynamic-v2.0-gguf">Unsloth Dynamic 2.0</a> achieves superior accuracy & outperforms other leading quants.</em>
46
+ </p>
47
+ <div style="display: flex; gap: 5px; align-items: center; ">
48
+ <a href="https://github.com/unslothai/unsloth/">
49
+ <img src="https://github.com/unslothai/unsloth/raw/main/images/unsloth%20new%20logo.png" width="133">
50
+ </a>
51
+ <a href="https://discord.gg/unsloth">
52
+ <img src="https://github.com/unslothai/unsloth/raw/main/images/Discord%20button.png" width="173">
53
+ </a>
54
+ <a href="https://docs.unsloth.ai/">
55
+ <img src="https://raw.githubusercontent.com/unslothai/unsloth/refs/heads/main/images/documentation%20green%20button.png" width="143">
56
+ </a>
57
+ </div>
58
+ </div>
59
+
60
+
61
+ # Hermes 4 — Llama-3.1 70B
62
+
63
+ ![image/jpeg](https://cdn-uploads.huggingface.co/production/uploads/6317aade83d8d2fd903192d9/roT9o5bMYBtQziRMlaSDf.jpeg)
64
+
65
+ ## Model Description
66
+
67
+ Hermes 4 70B is a frontier, hybrid-mode **reasoning** model based on Llama-3.1-70B by Nous Research that is aligned to **you**.
68
+
69
+ Read the Hermes 4 technical report here: <a href="https://arxiv.org/abs/2508.18255">Hermes 4 Technical Report</a>
70
+
71
+ Chat with Hermes in Nous Chat: https://chat.nousresearch.com
72
+
73
+ 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.
74
+
75
+
76
+ ## What’s new vs Hermes 3
77
+
78
+ - **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.
79
+ - **Hybrid reasoning mode** with explicit `<think>…</think>` segments when the model decides to deliberate, and options to make your responses faster when you want.
80
+ - **Reasoning** that is top quality, expressive, improves math, code, STEM, logic, and even creative writing and subjective responses.
81
+ - **Schema adherence & structured outputs**: trained to produce valid JSON for given schemas and to repair malformed objects.
82
+ - **Much easier to steer and align**: extreme improvements on steerability, especially on reduced refusal rates.
83
+
84
+ ## Our Mission: Frontier Capabilities Aligned to You
85
+
86
+ 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.
87
+
88
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6317aade83d8d2fd903192d9/t_HvRYPEHV0pc8iS2zHHn.png)
89
+
90
+ Hermes 4 achieves SOTA on RefusalBench across all popular closed and open models in being helpful and conforming to your values, without censorship.
91
+
92
+ ## Benchmarks (Hermes 4 70B)
93
+
94
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6317aade83d8d2fd903192d9/Sa-X7ErRF0ej20P8qBv9i.png)
95
+
96
+ > Full tables, settings, and comparisons are in the technical report.
97
+
98
+ ## Prompt Format
99
+
100
+ Hermes 4 uses Llama-3-Chat format with role headers and special tags.
101
+
102
+ **Basic chat:**
103
+ ```
104
+ <|start_header_id|>system<|end_header_id|>
105
+
106
+ You are Hermes 4. Be concise and helpful.<|eot_id|>
107
+ <|start_header_id|>user<|end_header_id|>
108
+
109
+ Explain the photoelectric effect simply.<|im_end|>
110
+ <|start_header_id|>assistant<|end_header_id|>
111
+ ```
112
+
113
+ ### Reasoning mode
114
+
115
+ Reasoning mode can be activated with the chat template via the flag `thinking=True` or by using the following system prompt:
116
+
117
+ ```
118
+ 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.
119
+ ```
120
+
121
+ 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.
122
+
123
+ When the model chooses to deliberate, it emits:
124
+
125
+ ```
126
+ <|start_header_id|>assistant<|end_header_id|>
127
+ <think>
128
+ …model’s internal reasoning may appear here…
129
+ </think>
130
+ Final response starts here…<|eot_id|>
131
+ ```
132
+
133
+ Additionally, we provide a flag to keep the content inbetween the `<think> ... </think>` that you can play with by setting `keep_cots=True`
134
+
135
+
136
+ ## Function Calling & Tool Use
137
+
138
+ Hermes 4 supports function/tool calls *within* a single assistant turn, produced after it's reasoning:
139
+
140
+ **System message (example):**
141
+
142
+ ```
143
+ <|im_start|>system
144
+ You are a function-calling AI. Tools are provided inside <tools>…</tools>.
145
+ When appropriate, call a tool by emitting a <tool_call>{...}</tool_call> object.
146
+ After a tool responds (as <tool_response>), continue reasoning inside <think> and produce the final answer.
147
+ <tools>
148
+ {"type":"function","function":{"name":"get_weather","description":"Get weather by city","parameters":{"type":"object","properties":{"city":{"type":"string"}},"required":["city"]}}}
149
+ </tools><|im_end|>
150
+ ```
151
+
152
+ 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.
153
+
154
+ 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`.
155
+
156
+ ## Inference Notes
157
+
158
+ - **Sampling defaults that work well:** `temperature=0.6, top_p=0.95, top_k=20`.
159
+ - **Template:** Use the Llama chat format for Hermes 4 70B and 405B as shown above, or set `add_generation_prompt=True` when using `tokenizer.apply_chat_template(...)`.
160
+
161
+ ### Transformers example
162
+
163
+ ```python
164
+ from transformers import AutoTokenizer, AutoModelForCausalLM
165
+ import torch
166
+
167
+ model_id = "NousResearch/Hermes-4-Llama-3.1-70B"
168
+
169
+ tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
170
+ model = AutoModelForCausalLM.from_pretrained(
171
+ model_id,
172
+ torch_dtype=torch.float16,
173
+ device_map="auto"
174
+ )
175
+
176
+ messages = [
177
+ {"role":"system","content":"You are Hermes 4. Be concise."},
178
+ {"role":"user","content":"Summarize CRISPR in 3 sentences."}
179
+ ]
180
+
181
+ inputs = tokenizer.apply_chat_template(
182
+ messages, add_generation_prompt=True, return_tensors="pt"
183
+ ).to(model.device)
184
+
185
+ outputs = model.generate(
186
+ **inputs, max_new_tokens=400, temperature=0.6, top_p=0.95, top_k=20, do_sample=True
187
+ )
188
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
189
+ ```
190
+
191
+ For production serving on multi-GPU nodes, consider tensor parallel inference engines (e.g., SGLang/vLLM backends) with prefix caching.
192
+
193
+ ## Inference Providers:
194
+
195
+ ### Nous Portal:
196
+
197
+ <a href="https://portal.nousresearch.com"><img width=256 alt="chutes logo" src="https://cdn-uploads.huggingface.co/production/uploads/6317aade83d8d2fd903192d9/6YytY7N0mjCnBQvWo3qtv.png"></a>
198
+
199
+ ### Chutes:
200
+
201
+ <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>
202
+
203
+ ### Nebius:
204
+
205
+ <a href="https://nebius.com/services/studio-inference-service">
206
+ <picture>
207
+ <source media="(prefers-color-scheme: dark)" srcset="https://cdn-uploads.huggingface.co/production/uploads/6317aade83d8d2fd903192d9/vhL0oAomFa_awBdt2KF_x.png">
208
+ <source media="(prefers-color-scheme: light)" srcset="https://cdn-uploads.huggingface.co/production/uploads/64b21cbb2fc8324fcb1dac03/LjAfeFfAz8ac5rV-iiwj5.png">
209
+ <img width=256 alt="nebius.com logo" src="https://cdn-uploads.huggingface.co/production/uploads/64b21cbb2fc8324fcb1dac03/LjAfeFfAz8ac5rV-iiwj5.png">
210
+ </picture>
211
+ </a>
212
+
213
+ ### Luminal:
214
+
215
+ <a href="https://luminalai.com/">
216
+ <img width=256 alt="luminal logo" src="https://cdn-uploads.huggingface.co/production/uploads/6317aade83d8d2fd903192d9/FIHsRdjMMP0HUjebiuJyH.png">
217
+ </a>
218
+
219
+ # Quantized / Smaller Variants
220
+
221
+ Hermes 4 is available as BF16 original weights as well as BF16 as well as FP8 variants and GGUF variants by LM Studio.
222
+
223
+ FP8: https://huggingface.co/NousResearch/Hermes-4-70B-FP8
224
+
225
+ GGUF (Courtesy of LM Studio team!):
226
+ https://huggingface.co/lmstudio-community/Hermes-4-70B-GGUF
227
+
228
+ Hermes 4 is also available in smaller sizes (e.g., 70B) with similar prompt formats.
229
+
230
+ See the Hermes 4 collection to explore them all:
231
+ https://huggingface.co/collections/NousResearch/hermes-4-collection-68a731bfd452e20816725728
232
+
233
+ # How to cite
234
+
235
+ ```bibtex
236
+ @misc{teknium2025hermes4technicalreport,
237
+ title={Hermes 4 Technical Report},
238
+ 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},
239
+ year={2025},
240
+ eprint={2508.18255},
241
+ archivePrefix={arXiv},
242
+ primaryClass={cs.AI},
243
+ url={https://arxiv.org/abs/2508.18255},
244
+ }
245
+ ```