Soldier Boy uses qwen2.5:3b-instruct-q4_0 running locally by default for all narration and context extraction, ensuring absolute privacy. However, you can configure an optional Gemini 2.5 Flash or NVIDIA NIM API key for richer, faster closing monologues. You can use either a free or premium API key.
Note on API limits: If you are using a free Gemini API key, Google limits requests to 15-20 per day. For unlimited chats without worrying about rate limits, stick to the default local SLM.
Get your key:
- Go to https://aistudio.google.com/apikey
- Create an API key
- Paste it into
config.yamlin the project root:
gemini_api_key: "YOUR_GEMINI_API_KEY"(Alternatively, you can set it as an environment variable GEMINI_API_KEY, but config.yaml is recommended for reliability.)
echo 'export GEMINI_API_KEY="your_key_here"' >> ~/.bashrc
source ~/.bashrc
echo $GEMINI_API_KEY # verifyecho 'export GEMINI_API_KEY="your_key_here"' >> ~/.zshrc
source ~/.zshrc
echo $GEMINI_API_KEY # verifyNote (zsh users): If your
.zshrcsources.bashrc, you may seeshopterrors becauseshoptis bash-only.
Check withgrep bashrc ~/.zshrcand remove the offending line if found:sed -i '/bashrc/d' ~/.zshrc
set -Ux GEMINI_API_KEY "your_key_here"
echo $GEMINI_API_KEY # verifyecho 'export GEMINI_API_KEY="your_key_here"' >> ~/.profile
. ~/.profile
echo $GEMINI_API_KEY # verifyThe soldierboy system command at /usr/local/bin/soldierboy is a bash script. If you want the key baked in at the wrapper level (so it works regardless of which shell calls it), edit it with:
sudo nano /usr/local/bin/soldierboyThe file should look like this — add the export line:
#!/bin/bash
export GEMINI_API_KEY="your_key_here"
source /path/to/your/venv/bin/activate # added by installer
cd /path/to/SOLDIER-BOY
exec python /path/to/SOLDIER-BOY/soldierboy.py "$@"This guarantees narration works even when Soldier Boy is launched from a desktop icon, a cron job, or any shell that hasn't loaded your personal config.
Soldier Boy falls back to local Ollama automatically if cloud APIs are unavailable. Never hardcode keys inside source code — use config.yaml or environment variables.