Kowalski Docs

Environment Variables

Kowalski's configurable environment variables

Important

Take care of your .env file, as it is so much important and needs to be secret (like your passwords), as anyone can do whatever they want to the bot with this token!

Bot

General

VariableRequired?Description
botSourceYesPut the link to your bot source code.
botPrivacyYesPut the link to your bot privacy policy.
maxRetriesYesMaximum number of retries for a failing command on Kowalski. Default is 5. If the limit is hit, the bot will crash past this number.
botTokenYesPut your bot token that you created at @BotFather.
longerLogsYesSet to true to enable verbose logging whenever possible.
botAdminsYesPut the ID of the people responsible for managing the bot. They can use some administrative + exclusive commands on any group.

AI Features (optional)

VariableRequired?Description
ollamaEnabledNoEnables/disables AI features
ollamaApiNoOllama API endpoint for various AI features, will be disabled if not set
handlerTimeoutNoHow long handlers will wait before timing out. Set this high if using large AI models.
flashModelNoWhich model will be used for /ask
thinkingModelNoWhich model will be used for /think
updateEveryCharsNoThe amount of characters until message update triggers (for streaming response)

Data + Persistence

VariableRequired?Description
databaseUrlYesDatabase server configuration (see .env.example)
valkeyBaseUrlYesThe hostname of your Valkey instance.
valkeyPortYesThe port of your Valkey instance.

API Keys

VariableRequired?Description
lastKeyYesLast.fm API key, for use on lastfm.js functions, like see who is listening to what song and etc.
weatherKeyYesWeather.com API key, used for the /weather command.

Note

Further, advanced fine-tuning and configuration can be done in TypeScript with the files in the /config folder. See the Configuration Files page for more information.

WebUI

VariableRequired?Description
botApiUrlYesLikely will stay the same, but changes the API that the bot exposes
databaseUrlYesDatabase server configuration (see .env.example). Should match .env
valkeyBaseUrlYesThe hostname of your Valkey instance. Should match .env
valkeyPortYesThe port of your Valkey instance. Should match .env
ratelimitSaltYesThe salt used for hashing IP addresses in Valkey. This should be changed in production.
longerLogsYesSet to true to enable verbose logging whenever possible.