The problem
pgbot answers "what's wrong?" with findings computed deterministically in Go from Postgres' own statistics views, then tells you what changed and why it matters by diffing against a local baseline. I especially appreciate the discipline behind the optional ask/explain AI layer: the model only interprets those deterministic findings (labeled 🤖 generated by … — verify before acting), and the report stands if no key is set.
That discipline is why more model choice helps pgbot's users: developers and DBAs triaging databases they don't own get the same trustworthy report whichever provider writes the plain-language reading — today OpenAI or Gemini, with PGBOT_OPENAI_URL already accepting any OpenAI-compatible endpoint. Adding OrcaRouter as a selectable provider gives them one API key across many models, plus automatic failover and usage tracking for teams.
I'd like to propose OrcaRouter as an optional AI provider for pgbot explain / pgbot ask. It would sit alongside the existing OpenAI and Gemini providers and change nothing about them:
- OpenAI-compatible and drop-in. OrcaRouter exposes an OpenAI-compatible API and uses standard API-key authentication. The natural integration point is the existing environment-keyed provider selection — an OrcaRouter key recognized alongside
OPENAI_API_KEY/GEMINI_API_KEY, or documented as an PGBOT_OPENAI_URL-compatible endpoint, with a default base URL and model override. Keys would stay environment-only, never flags, matching pgbot's current invariants.
- Why it's relevant here: automatic model routing and provider failover (so
pgbot explain still returns a reading when an upstream model is down), prompt caching for the repeated Context blocks pgbot sends, and usage tracking with budgets and team access for organizations running pgbot across many databases.
- Open-source traction. OrcaRouter is already adopted by open-source projects including Dify, goose, promptfoo, and OpenCode/models.dev; see https://www.orcarouter.ai/built-with.
Disclosure: OrcaRouter runs an optional open-source partner program in which approved OSS projects can receive a 5% revenue share from OrcaRouter usage attributed to their integration. Participation is not a prerequisite for the integration, and I'm happy to follow any disclosure or governance requirements pgbot's maintainers prefer.
I'm an engineer on the OrcaRouter team; this is a proposal only, with no code or tests included. If it sounds useful, I'd welcome your views on the integration point — and with your approval, I'd be glad to submit an implementation PR that respects pgbot's read-only and determinism invariants.
The problem
pgbot answers "what's wrong?" with findings computed deterministically in Go from Postgres' own statistics views, then tells you what changed and why it matters by diffing against a local baseline. I especially appreciate the discipline behind the optional
ask/explainAI layer: the model only interprets those deterministic findings (labeled🤖 generated by … — verify before acting), and the report stands if no key is set.That discipline is why more model choice helps pgbot's users: developers and DBAs triaging databases they don't own get the same trustworthy report whichever provider writes the plain-language reading — today OpenAI or Gemini, with
PGBOT_OPENAI_URLalready accepting any OpenAI-compatible endpoint. Adding OrcaRouter as a selectable provider gives them one API key across many models, plus automatic failover and usage tracking for teams.I'd like to propose OrcaRouter as an optional AI provider for
pgbot explain/pgbot ask. It would sit alongside the existing OpenAI and Gemini providers and change nothing about them:OPENAI_API_KEY/GEMINI_API_KEY, or documented as anPGBOT_OPENAI_URL-compatible endpoint, with a default base URL and model override. Keys would stay environment-only, never flags, matching pgbot's current invariants.pgbot explainstill returns a reading when an upstream model is down), prompt caching for the repeated Context blocks pgbot sends, and usage tracking with budgets and team access for organizations running pgbot across many databases.Disclosure: OrcaRouter runs an optional open-source partner program in which approved OSS projects can receive a 5% revenue share from OrcaRouter usage attributed to their integration. Participation is not a prerequisite for the integration, and I'm happy to follow any disclosure or governance requirements pgbot's maintainers prefer.
I'm an engineer on the OrcaRouter team; this is a proposal only, with no code or tests included. If it sounds useful, I'd welcome your views on the integration point — and with your approval, I'd be glad to submit an implementation PR that respects pgbot's read-only and determinism invariants.