Set up models — discover what the user already has first; only ask if nothing usable is found.
There are two model decisions:
- Supervisor — the LLM the provider calls for orchestration (planning interview, tool routing, status). Needs reliable function/tool-calling.
- Worker — the model spawned OpenCode sessions use to write code. Workers run through OpenCode, so they already use OpenCode's providers/auth.
Discover existing credentials/models before configuring anything:
opencode auth list — which providers are authenticated.
opencode models — available model ids (e.g. opencode/deepseek-v4-flash-free, anthropic/claude-*).
Supervisor: if the user has a keyed provider authenticated in OpenCode (e.g. Google, OpenCode Zen), the provider auto-detects it — no separate key needed. So usually you do nothing here. Only set RALPH_SUPERVISOR_API_KEY (+ RALPH_SUPERVISOR_MODEL / RALPH_SUPERVISOR_BASE_URL) or .opencode/ralph-provider.json supervisor if the user wants a specific provider/model, or if no keyed provider is authenticated.
Worker: leaving it unset is fine — workers use OpenCode's configured default model. To run coding on a free model, recommend (don't force) setting .opencode/ralph-provider.json worker.providerID + worker.modelID to a free OpenCode model such as opencode / deepseek-v4-flash-free. Confirm with the user before writing it.
If nothing usable is found (no authenticated provider, no key): direct the user to authenticate before launching, e.g.:
opencode auth login
or set RALPH_SUPERVISOR_API_KEY. Do not start the provider expecting the supervisor to work until at least one credential path exists. See references/config-files.md.