docs: document ANTHROPIC_API_KEY + GPT/Claude backend switch

Update the two deployment guides to cover the new env vars and the runtime
switch: ANTHROPIC_API_KEY / netrc machine 'anthropic', CONJURER_AI_CONFIG
(gpt|claude), the $gadaj_teraz command, and the note that DALL-E + personal
assistants stay on OpenAI regardless of the switch.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Michal Tuszowski
2026-07-10 23:39:21 +02:00
parent 3d9d47aa90
commit 9f0191fba2
2 changed files with 45 additions and 1 deletions
+18 -1
View File
@@ -43,11 +43,28 @@ You can rebalance as follows:
2. Edit each `docker/env/*.env` to replace `HACKME!` with real values:
- `DISCORD_TOKEN`, `OPENAI_API_KEY`, `CONJURER_API_KEY` (use the same value for
all services).
- `ANTHROPIC_API_KEY` — only if you want the Claude backend (see “AI backend
switch” below). Safe to leave unset while running on GPT.
- For musician/librarian, adjust mounts to the SMB paths you will mount on the
Pis, e.g. `/mnt/conjurer/music`.
- Set `CONJURER_CROSSREF_MAILTO` to a real email as required by Crossref.
3. If you rely on `.netrc`, copy it to `C:\Conjurer\secrets\.netrc` and set
`CONJURER_NETRC_FILE` accordingly.
`CONJURER_NETRC_FILE` accordingly. The bot reads netrc machines `discord`,
`openai`, `anthropic`, `assemblyai`, `spotipy`, `youtube`.
### AI backend switch (GPT ↔ Claude)
The AI chat features run on one backend at a time, selected by a single switch:
- **Startup:** `CONJURER_AI_CONFIG=gpt` (default) or `=claude` in `bot.env`. Unset
falls back to the `"active"` key in `system_gpt_settings.json`, then `"gpt"`.
- **Runtime:** the `$gadaj_teraz <config>` Discord command (Vykidailo only) flips
the backend live and persists the choice.
- The named configs (which provider, which models) live in
`system_gpt_settings.json` — add more there. Claude needs `ANTHROPIC_API_KEY`;
GPT needs `OPENAI_API_KEY`. Image generation (`imaginuje sobie:`) and personal
assistants always use OpenAI regardless of the switch (Anthropic has no
equivalent), and degrade quietly if `OPENAI_API_KEY` is absent.
## 4. Install Docker on Raspberry Pis and Windows
+27
View File
@@ -85,6 +85,33 @@ sudo chmod 600 /srv/conjurer/secrets/.netrc
(Alternatively skip netrc and set `DISCORD_TOKEN` / `OPENAI_API_KEY` in the env
file — those take precedence.)
For the **Claude backend** add an `anthropic` machine to the same netrc (or set
`ANTHROPIC_API_KEY` in `bot.env`):
```
machine anthropic
password sk-ant-...
```
You only need this if you actually switch the bot to Claude — see 1c-bis.
### 1c-bis. AI backend switch (GPT ↔ Claude)
The bot's AI chat runs on one backend at a time, chosen by a single switch:
- **At startup**, set `CONJURER_AI_CONFIG` in `bot.env``gpt` (default) or
`claude`. Leave it unset to use the `"active"` key in
`system_gpt_settings.json` (falls back to `gpt`).
- **At runtime**, `$gadaj_teraz <config>` (Vykidailo only) flips the backend live
and writes the choice back into `system_gpt_settings.json`.
The provider configs (which backend, which models) are collected in
`system_gpt_settings.json` under the third list element — add further AIs there.
`claude` needs `ANTHROPIC_API_KEY`; `gpt` needs `OPENAI_API_KEY`. Image
generation (`imaginuje sobie:`) and personal assistants stay on OpenAI whatever
the switch says (Anthropic has no equivalent) and degrade quietly if OpenAI is
not configured, so a Claude-only box still boots.
### 1d. Configure and launch
```bash