NAME
Langertha::Knarr::Handler::Engine - Knarr handler that proxies directly to a Langertha engine
VERSION
version 1.100
SYNOPSIS
use Langertha::Engine::Groq;
use Langertha::Knarr::Handler::Engine;
my $engine = Langertha::Engine::Groq->new(
api_key => $ENV{GROQ_API_KEY},
chat_model => 'llama-3.3-70b-versatile',
);
my $handler = Langertha::Knarr::Handler::Engine->new(
engine => $engine,
model_id => 'groq-llama-3.3-70b',
);
DESCRIPTION
Wraps a single Langertha::Engine::* instance and exposes it as a Knarr handler. Non-streaming requests are dispatched via $engine->chat_f with the full set of generation parameters (tools, tool_choice, response_format, temperature, max_tokens) forwarded from the client request — subject to the engine's reported capabilities. Streaming requests use simple_chat_stream_realtime_f for native token-by-token delivery; engines that don't support streaming fall back to a single-chunk emission.
For routing across multiple engines based on model name, use Langertha::Knarr::Handler::Router with a Langertha::Knarr::Router config instead.
engine
Required. Any object consuming Langertha::Role::Chat. Streaming support is detected via $engine->supports('streaming') (Langertha 0.500+) or the presence of simple_chat_stream_realtime_f.
model_id
Optional. The id reported by "list_models" and surfaced in responses. Defaults to the engine's chat_model, falling back to a derived name from the engine class.
SUPPORT
Issues
Please report bugs and feature requests on GitHub at https://github.com/Getty/langertha-knarr/issues.
IRC
Join #langertha on irc.perl.org or message Getty directly.
CONTRIBUTING
Contributions are welcome! Please fork the repository and submit a pull request.
AUTHOR
Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/
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.