Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

Merge pull request #5810 from AdityaUmale/fix2/5712-gemini-openrouter-picker

milind-sonicb83a9328096
diff --cc docs/decision-model.md
index fe6dad1221,a0c21ca31d..ac99ad8fb8
--- a/docs/decision-model.md
+++ b/docs/decision-model.md
@@@ -74,28 -68,17 +74,33 @@@ A failed decision falls back as describ
answer in the same shape through chat completions, and its probabilities
are its own estimate.
+- **Custom endpoint** sends decisions to a gateway you run or rent. Give it a
+ **Base URL** (for example `https://gateway.example.com/v1`; https, or http to
+ this machine only), the **Model ID** it serves, its **Protocol** and its API
+ key, sent as `Authorization: Bearer <key>`:
+ - **System One** posts Jev's request (`model`, `state`, `questions` keyed by
+ id) to `{base URL}/systemone` and reads `answers` by question id.
+ - **OpenAI Decisions** posts `model`, `input` (the state as text) and an
+ ordered `questions` list (`predicate`, `choice` with `choices`, `score`
+ with `levels`) to `{base URL}/decisions`, with `stream: false`, and reads
+ `answers` by position.
+
+ Answers go through the same checks as every other provider's. A custom
+ endpoint decides only: it does not read mail or a bot's `extract` calls,
+ which keep the reading providers below. **Test** shows how long it took,
+ like OpenRouter's.
+
- The model list holds decisions models only: a curated set, in the order of
- OpenRouter's decisions ranking, that shows only what OpenRouter's public
- catalog (`/models?output_modalities=decisions`) still lists, then the rest of
- that catalog. Chat models are not offered, though one saved by hand with
- `openrouterApi: "chat"` still works. If OpenRouter's catalog cannot be
- loaded, Settings shows the curated list and says so. A model saved by id (`decider.openrouterModel`) is
+ The model list holds decisions models first: a curated set, in the order of
+ OpenRouter's decisions ranking (Google's Gemini Decision 1 included), that
+ shows only what OpenRouter's public catalog
+ (`/models?output_modalities=decisions`) still lists, then the rest of that
+ catalog. Last, under **Gemini chat models (not calibrated)**, come the Gemini
+ Flash chat models that catalog's text list (`/models?output_modalities=text`)
+ says take a strict JSON schema; picking one saves `openrouterApi: "chat"`, so
+ its probabilities are its own estimate (and extraction uses it too, as with
+ any chat model). Use **Test** to check it answers in time. Other chat models are not offered, though
+ one saved by hand with `openrouterApi: "chat"` still works. If OpenRouter's
+ catalog cannot be loaded, Settings shows the curated list and says so. A model saved by id (`decider.openrouterModel`) is
used even if the list does not carry it. **Test** shows how long the model took;
above 1.5 seconds, rooms would fall back to the lead, so pick a faster one.
diff --cc src/components/DecisionModelSettings.tsx
index a7a5d64be6,dab5a4c843..6fc35c85ac
--- a/src/components/DecisionModelSettings.tsx
+++ b/src/components/DecisionModelSettings.tsx
@@@ -26,8 -13,9 +26,9 @@@ const COPY: Record<"jev" | "openrouter
/** The room decision budget in server/decider/room-routing.ts; slower falls back to the lead. */
const ROOM_BUDGET_MS = 1_500;
-type Provider = "jev" | "openrouter";
+type Provider = "jev" | "openrouter" | "custom";
- type ModelList = { source: "openrouter" | "builtin"; models: Array<{ id: string; name: string; group: "recommended" | "more"; api?: "chat" | "decisions" }> };
+ type ModelList = { source: "openrouter" | "builtin"; models: Array<{ id: string; name: string; group: "recommended" | "more" | "chat"; api?: "chat" | "decisions" }> };
+ const MODEL_GROUP = { recommended: "decider.model.recommended", more: "decider.model.more", chat: "decider.model.geminiChat" } as const satisfies Record<string, LocaleKey>;
type TestResult = { ok: true; latencyMs: number } | { ok: false; reason: string; status?: number };
const FAILURES: Record<string, LocaleKey> = {