Text Generation
Transformers
Safetensors
English
llama
Llama-3.1
instruct
finetune
reasoning
hybrid-mode
chatml
function calling
tool use
json mode
structured outputs
atropos
dataforge
long context
roleplaying
chat
conversational
text-generation-inference
Instructions to use NousResearch/Hermes-4-70B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NousResearch/Hermes-4-70B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="NousResearch/Hermes-4-70B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("NousResearch/Hermes-4-70B") model = AutoModelForCausalLM.from_pretrained("NousResearch/Hermes-4-70B", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use NousResearch/Hermes-4-70B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "NousResearch/Hermes-4-70B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NousResearch/Hermes-4-70B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/NousResearch/Hermes-4-70B
- SGLang
How to use NousResearch/Hermes-4-70B 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 "NousResearch/Hermes-4-70B" \ --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": "NousResearch/Hermes-4-70B", "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 "NousResearch/Hermes-4-70B" \ --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": "NousResearch/Hermes-4-70B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use NousResearch/Hermes-4-70B with Docker Model Runner:
docker model run hf.co/NousResearch/Hermes-4-70B
Add pipeline tag: text-generation (#4)
Browse files- Add pipeline tag: text-generation (ff5e414ed7f767ce3744c86f1e8aa66d70315ddd)
Co-authored-by: Niels Rogge <[email protected]>
README.md
CHANGED
|
@@ -1,7 +1,10 @@
|
|
| 1 |
---
|
|
|
|
| 2 |
language:
|
| 3 |
- en
|
|
|
|
| 4 |
license: llama3
|
|
|
|
| 5 |
tags:
|
| 6 |
- Llama-3.1
|
| 7 |
- instruct
|
|
@@ -18,18 +21,14 @@ tags:
|
|
| 18 |
- long context
|
| 19 |
- roleplaying
|
| 20 |
- chat
|
| 21 |
-
base_model: meta-llama/Meta-Llama-3.1-70B
|
| 22 |
-
library_name: transformers
|
| 23 |
widget:
|
| 24 |
- example_title: Hermes 4
|
| 25 |
messages:
|
| 26 |
- role: system
|
| 27 |
-
content:
|
| 28 |
-
You are Hermes 4, a capable, neutrally-aligned assistant. Prefer concise,
|
| 29 |
correct answers.
|
| 30 |
- role: user
|
| 31 |
-
content:
|
| 32 |
-
Explain the difference between BFS and DFS to a new CS student.
|
| 33 |
model-index:
|
| 34 |
- name: Hermes-4-Llama-3.1-70B
|
| 35 |
results: []
|
|
|
|
| 1 |
---
|
| 2 |
+
base_model: meta-llama/Meta-Llama-3.1-70B
|
| 3 |
language:
|
| 4 |
- en
|
| 5 |
+
library_name: transformers
|
| 6 |
license: llama3
|
| 7 |
+
pipeline_tag: text-generation
|
| 8 |
tags:
|
| 9 |
- Llama-3.1
|
| 10 |
- instruct
|
|
|
|
| 21 |
- long context
|
| 22 |
- roleplaying
|
| 23 |
- chat
|
|
|
|
|
|
|
| 24 |
widget:
|
| 25 |
- example_title: Hermes 4
|
| 26 |
messages:
|
| 27 |
- role: system
|
| 28 |
+
content: You are Hermes 4, a capable, neutrally-aligned assistant. Prefer concise,
|
|
|
|
| 29 |
correct answers.
|
| 30 |
- role: user
|
| 31 |
+
content: Explain the difference between BFS and DFS to a new CS student.
|
|
|
|
| 32 |
model-index:
|
| 33 |
- name: Hermes-4-Llama-3.1-70B
|
| 34 |
results: []
|