feat: add Nous Research Hermes models as provider

- Add Nous.ts LLM provider extending OpenAI
- Add Hermes 3 and Hermes 4 model entries (70B, 405B, 36B variants)
- Add Nous to providers list with API base configuration
- Add Hermes detection for ChatML template in autodetect
- Add Nous to PROVIDER_HANDLES_TEMPLATING
- Add documentation page for Nous Research

Amp-Thread-ID: https://ampcode.com/threads/T-019c0611-a43c-764f-83a5-b91821140566
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Abhaykhanna3 2026-01-28 15:48:41 -05:00
parent cfd9bc4e31
commit 1ba9a669d6
No known key found for this signature in database
6 changed files with 217 additions and 0 deletions

View file

@ -70,6 +70,7 @@ const PROVIDER_HANDLES_TEMPLATING: string[] = [
"groq",
"gemini",
"docker",
"nous",
// TODO add these, change to inverted logic so only the ones that need templating are hardcoded
// Asksage.ts
// Azure.ts
@ -365,6 +366,10 @@ function autodetectTemplateType(model: string): TemplateType | undefined {
return "deepseek";
}
if (lower.includes("hermes")) {
return "chatml";
}
if (lower.includes("ninja") || lower.includes("openchat")) {
return "openchat";
}

13
core/llm/llms/Nous.ts Normal file
View file

@ -0,0 +1,13 @@
import { LLMOptions } from "../..";
import OpenAI from "./OpenAI";
class Nous extends OpenAI {
static providerName = "nous";
static defaultOptions: Partial<LLMOptions> = {
apiBase: "https://inference-api.nousresearch.com/v1",
useLegacyCompletionsEndpoint: false,
};
}
export default Nous;

View file

@ -43,6 +43,7 @@ import Moonshot from "./Moonshot";
import Msty from "./Msty";
import NCompass from "./NCompass";
import Nebius from "./Nebius";
import Nous from "./Nous";
import Novita from "./Novita";
import Nvidia from "./Nvidia";
import Ollama from "./Ollama";
@ -114,6 +115,7 @@ export const LLMClasses = [
Cerebras,
Asksage,
Nebius,
Nous,
Venice,
VertexAI,
xAI,

View file

@ -0,0 +1,95 @@
---
title: Nous Research
slug: ../nous
---
<Tip>
**Discover Nous Research Hermes models for advanced reasoning and instruction following**
</Tip>
<Info>
You can get an API key from the [Nous Research Portal](https://portal.nousresearch.com/).
</Info>
## Available Models
| Model | Context Length | Description |
|-------|----------------|-------------|
| `Hermes-4.3-36B` | 128k | Compact reasoning model with thinking capabilities |
| `Hermes-4-70B` | 128k | Large reasoning model with 128k context |
| `Hermes-4-405B` | 128k | Flagship reasoning model |
| `Hermes-3-Llama-3.1-70B` | 32k | Instruction-tuned on Llama 3.1 70B |
| `Hermes-3-Llama-3.1-405B` | 32k | Instruction-tuned on Llama 3.1 405B |
## Configuration
<Tabs>
<Tab title="YAML">
```yaml title="config.yaml"
name: My Config
version: 0.0.1
schema: v1
models:
- name: Hermes 4.3 36B
provider: nous
model: Hermes-4.3-36B
apiKey: <YOUR_NOUS_API_KEY>
```
</Tab>
<Tab title="JSON">
```json title="config.json"
{
"models": [
{
"title": "Hermes 4.3 36B",
"provider": "nous",
"model": "Hermes-4.3-36B",
"apiKey": "<YOUR_NOUS_API_KEY>"
}
]
}
```
</Tab>
</Tabs>
## Reasoning Mode
Hermes 4 and DeepHermes models support reasoning with chain-of-thought. To enable reasoning, use the following system prompt:
```
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.
```
<Tabs>
<Tab title="YAML">
```yaml title="config.yaml"
name: My Config
version: 0.0.1
schema: v1
models:
- name: Hermes 4.3 36B (Reasoning)
provider: nous
model: Hermes-4.3-36B
apiKey: <YOUR_NOUS_API_KEY>
systemMessage: |
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.
```
</Tab>
<Tab title="JSON">
```json title="config.json"
{
"models": [
{
"title": "Hermes 4.3 36B (Reasoning)",
"provider": "nous",
"model": "Hermes-4.3-36B",
"apiKey": "<YOUR_NOUS_API_KEY>",
"systemMessage": "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."
}
]
}
```
</Tab>
</Tabs>

View file

@ -37,6 +37,76 @@ export interface ModelPackage {
}
export const models: { [key: string]: ModelPackage } = {
hermes3Llama31_405b: {
title: "Hermes 3 Llama 3.1 405B",
description:
"Nous Research's Hermes 3, a powerful instruction-tuned model built on Llama 3.1 405B with strong reasoning and tool use capabilities.",
refUrl: "https://nousresearch.com/hermes3",
params: {
title: "Hermes 3 Llama 3.1 405B",
model: "Hermes-3-Llama-3.1-405B",
contextLength: 32_000,
},
icon: "nous.png",
providerOptions: ["nous"],
isOpenSource: true,
},
hermes3Llama31_70b: {
title: "Hermes 3 Llama 3.1 70B",
description:
"Nous Research's Hermes 3, built on Llama 3.1 70B with strong instruction following and reasoning.",
refUrl: "https://nousresearch.com/hermes3",
params: {
title: "Hermes 3 Llama 3.1 70B",
model: "Hermes-3-Llama-3.1-70B",
contextLength: 32_000,
},
icon: "nous.png",
providerOptions: ["nous"],
isOpenSource: true,
},
hermes4_405b: {
title: "Hermes 4 405B",
description:
"Nous Research's Hermes 4, featuring enhanced reasoning with thinking tags for chain-of-thought.",
refUrl: "https://nousresearch.com",
params: {
title: "Hermes 4 405B",
model: "Hermes-4-405B",
contextLength: 128_000,
},
icon: "nous.png",
providerOptions: ["nous"],
isOpenSource: true,
},
hermes4_70b: {
title: "Hermes 4 70B",
description:
"Nous Research's Hermes 4 70B with reasoning capabilities and 128k context.",
refUrl: "https://nousresearch.com",
params: {
title: "Hermes 4 70B",
model: "Hermes-4-70B",
contextLength: 128_000,
},
icon: "nous.png",
providerOptions: ["nous"],
isOpenSource: true,
},
hermes43_36b: {
title: "Hermes 4.3 36B",
description:
"Nous Research's Hermes 4.3 36B, a compact reasoning model with 128k context.",
refUrl: "https://nousresearch.com",
params: {
title: "Hermes 4.3 36B",
model: "Hermes-4.3-36B",
contextLength: 128_000,
},
icon: "nous.png",
providerOptions: ["nous"],
isOpenSource: true,
},
deepseekV3Chat: {
title: "deepseek v3",
description: "A model from deekseek for chat",

View file

@ -1167,4 +1167,36 @@ To get started, [register](https://dataplatform.cloud.ibm.com/registration/stepo
],
apiKeyUrl: "https://api.router.tetrate.ai/",
},
nous: {
title: "Nous Research",
provider: "nous",
refPage: "nous",
description:
"Nous Research provides Hermes models via an OpenAI-compatible API with advanced reasoning capabilities.",
longDescription:
"Nous Research offers Hermes models including Hermes 3 and Hermes 4 with strong instruction following and reasoning. Get an API key at [portal.nousresearch.com](https://portal.nousresearch.com).",
icon: "nous.png",
tags: [ModelProviderTags.RequiresApiKey, ModelProviderTags.OpenSource],
params: {
apiBase: "https://inference-api.nousresearch.com/v1",
},
collectInputFor: [
{
inputType: "text",
key: "apiKey",
label: "API Key",
placeholder: "Enter your Nous Research API key",
required: true,
},
...completionParamsInputsConfigs,
],
packages: [
models.hermes43_36b,
models.hermes4_70b,
models.hermes4_405b,
models.hermes3Llama31_70b,
models.hermes3Llama31_405b,
],
apiKeyUrl: "https://portal.nousresearch.com",
},
};