NAME

Langertha::Engine::NousResearch - Nous Research Inference API

VERSION

version 0.202

SYNOPSIS

use Langertha::Engine::NousResearch;

my $nous = Langertha::Engine::NousResearch->new(
    api_key => $ENV{NOUSRESEARCH_API_KEY},
    model   => 'Hermes-4-70B',
);

print $nous->simple_chat('Explain the Hermes prompt format');

# Chain-of-thought reasoning (Hermes 4)
my $nous = Langertha::Engine::NousResearch->new(
    api_key   => $ENV{NOUSRESEARCH_API_KEY},
    model     => 'Hermes-4-70B',
    reasoning => 1,
);

my $response = $nous->simple_chat('Solve this step by step...');
say $response;                  # clean answer
say $response->thinking;        # chain-of-thought reasoning

# MCP tool calling (hermes_tools enabled by default)
use Future::AsyncAwait;

my $nous = Langertha::Engine::NousResearch->new(
    api_key     => $ENV{NOUSRESEARCH_API_KEY},
    model       => 'Hermes-4-70B',
    mcp_servers => [$mcp],
);

my $response = await $nous->chat_with_tools_f('Add 7 and 15');

DESCRIPTION

Provides access to Nous Research's inference API. Composes Langertha::Role::OpenAICompatible with Nous's endpoint (https://inference-api.nousresearch.com/v1) and Hermes tool calling.

Available models: Hermes-4-70B (default), Hermes-4-405B.

hermes_tools is enabled by default. Tool descriptions are injected into the system prompt as <tools> XML, and <tool_call> tags are parsed from the model output. No server-side tool calling support required. See Langertha::Role::Tools for customization options.

Get your API key at https://portal.nousresearch.com/ and set LANGERTHA_NOUSRESEARCH_API_KEY.

THIS API IS WORK IN PROGRESS

reasoning

reasoning => 1

Enable chain-of-thought reasoning for Hermes 4 and DeepHermes 3 models. Prepends the standard Nous reasoning system prompt that instructs the model to use <think> tags. The thinking content is automatically extracted into "thinking" in Langertha::Response by Langertha::Role::ThinkTag.

With DeepHermes 3, reasoning output appears inline as <think> tags (handled by the think tag filter). With Hermes 4 (without response prefill), reasoning appears in the reasoning_content response field (handled by native extraction).

Defaults to 0 (disabled).

SEE ALSO

SUPPORT

Issues

Please report bugs and feature requests on GitHub at https://github.com/Getty/langertha/issues.

CONTRIBUTING

Contributions are welcome! Please fork the repository and submit a pull request.

AUTHOR

Torsten Raudssus <torsten@raudssus.de> https://raudss.us/

COPYRIGHT AND LICENSE

This software is copyright (c) 2026 by Torsten Raudssus.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.