Configuration (.env)
Miku uses a .env file to manage important configurations. Below are details of the variables you need to note.
Required Variables
| Variable | Description |
|---|---|
DISCORD_TOKEN | Your Discord bot token. |
NVIDIA_API_KEY | API Key from the NVIDIA API Catalog. |
NVIDIA_MODEL | The language model to use (Default: google/gemma-3n-e4b-it). |
Discord RPC Configuration
Adjust the bot's presence status on Discord:
RPC_ENABLED: Enable/disable status display (true/false).RPC_STATUS: Status (online, idle, dnd, invisible).RPC_ACTIVITY_TYPE: Activity type (playing, listening, watching, competing, streaming).RPC_ACTIVITY_NAME: The text content to display.
Behavior and System
SYSTEM_PROMPT: The command that shapes Miku's personality.SYSTEM_RULES_MD: Path to the file containing additional rules (default:system_rules.md).TEMPERATURE: AI creativity (0.0 to 1.0).MAX_HISTORY: Number of conversation turns the bot will remember for each user.
Memory & Storage Management
MEMORY_IDLE_TTL_SECONDS: Time (seconds) memory is retained before being deleted if the user is inactive.CHAT_MEMORY_DB_PATH: Path to the chat history database file.BAN_DB_PATH: Path to the banned users database file.CALLNAMES_DB_PATH: Path to the nicknames database file.
Security (KomiFilter)
KOMIFILTER_ENABLED: Enable/disable the security filter.KOMIFILTER_BLOCK_RESPONSE_ON_LEAK: Block AI responses if system information leaks are detected.
Maintenance
RESTART_INTERVAL_HOURS: Interval for automatically restarting the bot to free up resources.