From 9f0191fba20b75f49c1ff54aa457a8598784815a Mon Sep 17 00:00:00 2001 From: Michal Tuszowski Date: Fri, 10 Jul 2026 23:39:21 +0200 Subject: [PATCH] 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 --- docs/deployment/DEPLOYMENT_GUIDE.md | 19 ++++++++++++++++++- docs/deployment/DOCKER_PROXMOX.md | 27 +++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/docs/deployment/DEPLOYMENT_GUIDE.md b/docs/deployment/DEPLOYMENT_GUIDE.md index 780e35c..9c6df3b 100644 --- a/docs/deployment/DEPLOYMENT_GUIDE.md +++ b/docs/deployment/DEPLOYMENT_GUIDE.md @@ -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 ` 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 diff --git a/docs/deployment/DOCKER_PROXMOX.md b/docs/deployment/DOCKER_PROXMOX.md index 96a91f0..02549e8 100644 --- a/docs/deployment/DOCKER_PROXMOX.md +++ b/docs/deployment/DOCKER_PROXMOX.md @@ -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 ` (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