NAME
Langertha::Knarr::CLI::Cmd::Start - Start the Knarr proxy server
VERSION
version 1.103
DESCRIPTION
Implements the knarr start command. Loads the config file, validates it, and starts the server.
With --from-env, the config is built automatically from environment variables when no config file is found — this is how the Docker image starts.
The listen addresses come from -p when given (each port on -H, default 0.0.0.0), otherwise from the config's listen:, which defaults to 127.0.0.1:8080 and 127.0.0.1:11434. -H alone changes nothing.
-w/--workers N (else the config's workers: or KNARR_WORKERS, default 1; a value below 1 stops start before the banner) serves from N processes: Knarr binds the listen addresses, runs auto-discovery and the capability probe once, then forks N workers that accept on the same sockets, and supervises them -- a worker that exits is restarted, SIGTERM/SIGINT stops them all. Sessions (a Raider conversation) live in one worker and are not routed back to it. See "workers" in Langertha::Knarr and "run" in Langertha::Knarr.
--remote-config (else the config's remote_config: or KNARR_REMOTE_CONFIG) allows a start without any model: no config file is needed (--from-env is then ignored), and every request but the admin routes answers 503 until the setup arrives by PUT /knarr/admin/config (see Langertha::Knarr::Admin). A config file may hold models and the rest of a setup as well: it is always in effect, and a delivered setup lies over it, in memory only. It needs KNARR_ADMIN_KEY (or admin_key:). With an admin key set the admin routes are on, and the worker count is set to 1 with a warning: a push reaches the memory of one process only.
With a token_auth: section (see "token_auth" in Langertha::Knarr::Config) the proxy checks a per-model token against the database instead of one shared key, and the requests are routed by the token's provider ("routes" in Langertha::Knarr::Config). The banner says Auth: token_auth (postgresql, routes: ...) and never the DSN, user, password or relation. The stack is built before the server starts, so a missing DBD::Pg stops start with token_auth backend postgresql needs DBD::Pg instead of failing the first request. The database connection is opened by the first token check of each serving process, so with -w every worker has its own and the parent never connects.
See knarr for the full option reference and Langertha::Knarr::Config for the configuration file format.
SEE ALSO
knarr — CLI synopsis and option reference
Langertha::Knarr — Full documentation
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.