Skip to main content

Configuration

Laserbeak uses a three-tier configuration system. Settings are resolved in this order (highest precedence first):

  1. CLI flags (e.g. --discord-token)
  2. Environment variables (prefixed with LASERBEAK_, e.g. LASERBEAK_DISCORD_TOKEN)
  3. Config file (config.yaml)

The config file is loaded from the first path found:

  • ./config.yaml
  • ~/.gobot-laserbeak/config.yaml
  • /etc/gobot-laserbeak/config.yaml

Getting started

cp config.yaml.example config.yaml
# Edit config.yaml with your tokens and channel IDs

All settings

SettingCLI FlagEnv VarDefaultDescription
discord.token--discord-tokenLASERBEAK_DISCORD_TOKENDiscord bot token (required)
discord.commandprefix--command-prefixLASERBEAK_DISCORD_COMMANDPREFIX!laser Bot command prefix
discord.guildid--guild-idLASERBEAK_DISCORD_GUILDIDGuild ID for auto-join
discord.voicechannelid--voice-channel-idLASERBEAK_DISCORD_VOICECHANNELIDVoice channel to auto-join
discord.textchannelid--text-channel-idLASERBEAK_DISCORD_TEXTCHANNELIDText channel for voice command output
llm.apikey--llm-api-keyLASERBEAK_LLM_APIKEYLLM API key (required)
llm.baseurl--llm-base-urlLASERBEAK_LLM_BASEURLhttps://api.openai.com/v1LLM API base URL
llm.model--llm-modelLASERBEAK_LLM_MODELgpt-4LLM model name
stt.apikey--stt-api-keyLASERBEAK_STT_APIKEYSTT API key (enables voice)
stt.baseurlLASERBEAK_STT_BASEURLhttps://api.openai.com/v1STT API base URL
stt.modelLASERBEAK_STT_MODELwhisper-1STT model name
bot.systempromptLASERBEAK_BOT_SYSTEMPROMPT(built-in)System prompt for LLM
bot.maxhistoryLASERBEAK_BOT_MAXHISTORY50Max conversation history per channel
bot.wakephrase--wake-phraseLASERBEAK_BOT_WAKEPHRASElaserWake phrase for voice commands
playoptions.apiurl--play-options-urlLASERBEAK_PLAYOPTIONS_APIURLURL to fetch play options
playoptions.cachettl--play-options-cache-ttlLASERBEAK_PLAYOPTIONS_CACHETTL5mCache TTL for play options

Example config file

discord:
token: "YOUR_DISCORD_BOT_TOKEN"
commandprefix: "!laser "
guildid: ""
voicechannelid: ""
textchannelid: ""

llm:
apikey: "YOUR_OPENAI_API_KEY"
baseurl: "https://api.openai.com/v1"
model: "gpt-4"

stt:
apikey: "YOUR_OPENAI_API_KEY"
baseurl: "https://api.openai.com/v1"
model: "whisper-1"

bot:
systemprompt: "You are Laserbeak, a helpful Discord assistant."
maxhistory: 50
wakephrase: "laser"

playoptions:
apiurl: ""
cachettl: "5m"

Example .env file

LASERBEAK_DISCORD_TOKEN=your-discord-token
LASERBEAK_LLM_APIKEY=your-openai-key
LASERBEAK_STT_APIKEY=your-openai-key
LASERBEAK_DISCORD_GUILDID=123456789
LASERBEAK_DISCORD_VOICECHANNELID=123456789
LASERBEAK_DISCORD_TEXTCHANNELID=123456789