lokalny-bot
A Discord bot called with a ping that answers with Claude from a Claude Code subscription or with a model from a local Ollama. Parameters before the text set the model, channel context, temperature, limit, role and an answer scheduled for later, and a benchmark mode runs the same prompt through every local model and returns a table of results. Every channel has its own session that survives a bot restart.
Overview
lokalny-bot is a Discord bot with two sources of answers: Claude from a Claude Code subscription and models running locally in Ollama. You call it with a ping and a question, and parameters before the text change the model and how it answers.
Claude without API billing
Claude does not go through the API but through a subprocess of the Claude Code CLI signed in on that account. The subprocess gets no tools at all, because it is meant to talk, not act as an agent with disk access, and it does not load the account's settings, hooks or plugins. The prompt goes to standard input, so neither quotes nor the length of the text can break the call.
Every channel has its own session with an id derived from the channel id, so the conversation survives a bot restart. The channel history goes into the session once, when it is created, and from then on the session itself carries the conversation.
Models from Ollama
The model list is never written into the code: the bot asks Ollama for it on every use, together with each model's capabilities, so a newly pulled model shows up in the help on its own. A model name can be shortened to its family or an alias.
Parameters
Parameters before the text
| Parameter | What it does |
|---|---|
| -m | Which model answers |
| -c | How many earlier channel messages to pull in as context |
| -t | Temperature |
| -s | An answer at a given time or after a given delay |
| -r | A custom system prompt |
| -l | A ceiling on the answer length |
| --seed | A seed for repeatable answers |
| --think | Thinking aloud on models that can do it |
| --bench | The same prompt on every model and a table of measurements |
The first word that is not a parameter starts the text, so a dash inside a sentence stays plain text. For parameters the Claude CLI does not support, the bot says so plainly under the answer instead of pretending they worked.
Help and permissions
The /help command lists the help topics, and /help with a topic name explains one parameter. The bot listens only to the configured operators, and without a token or an operator it stops and says why.
Questions about lokalny-bot
More projects
More work from the same category - see how we tackle similar challenges.
Have a similar project?
Get in touch - a quote is free and comes back within an hour.



