Skip to content

Providers & keys

CoSci reasons with a local heuristic engine by default, and uses a real LLM when one is configured. You bring your own key (or CLI) — there’s no CoSci account and no managed inference.

Provider priority

The first available provider wins; any failure falls through to the next, and finally to the heuristic engine:

  1. claude_cli — the local Claude Code CLI (claude), if on your PATH
  2. codex_cli — the local Codex CLI (codex), if on your PATH
  3. Gemini — Google Generative AI (GEMINI_API_KEY / GOOGLE_API_KEY)
  4. DeepSeek — (DEEPSEEK_API_KEY)
  5. Anthropic / OpenAI HTTP APIs — last resort, if keys are present

claude_cli / codex_cli need no API key — just the CLI on your PATH.

Configure

Copy backend/.env.example to backend/.env and set what you need. Never commit .env — it’s gitignored. Reference (not real values):

Terminal window
# turn the local CLIs into providers (slower: ~3–9 s/call; set 0 to use Gemini directly)
RC_USE_CLI_PROVIDERS=1
GEMINI_API_KEY=... # GOOGLE_API_KEY also accepted
RC_GOOGLE_MODEL=gemini-2.5-flash # a valid flash model
DEEPSEEK_API_KEY=...
RC_DEEPSEEK_MODEL=deepseek-chat
RC_OFFLINE=0 # 1 = hard offline (heuristic only)

Check what’s active

Terminal window
curl http://localhost:8799/agents/providers

…or open the Agents screen in the app. It shows which provider served each call, cache state, and online/offline status.

Run fully offline

Set RC_OFFLINE=1 and CoSci uses only its deterministic heuristic engine — no network, no keys, no external calls. Useful for demos, air-gapped machines, or just to keep everything on-device.

Next: grounding & anti-hallucination, or the scientific tools the online mode reaches.