You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/architecture.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,7 +57,7 @@ JSON request bodies are limited to 32 MiB. Oversized requests receive a JSON `41
57
57
58
58
## Model IDs and routes
59
59
60
-
Provider model IDs are generated by `src/lib/providers/index.js`. A direct model resolves to one enabled provider/model pair.
60
+
Provider model IDs are generated by `src/lib/providers/index.js`. Custom OpenAI-compatible connections use the readable form `<connection name>/custom/<upstream model>` while legacy hash-qualified IDs remain resolvable. A direct model resolves to one enabled provider/model pair.
61
61
62
62
A route is a persisted virtual model with members shaped like:
63
63
@@ -73,7 +73,7 @@ The router supports:
73
73
-`fallback`: members are attempted in their configured order.
74
74
-`round-robin`: each request rotates the starting member, then retains fallback behavior through the remaining members.
75
75
76
-
Timeouts, `408`, `429`, and `5xx` responses are retryable. The per-member timeout defaults to 60 seconds. An explicit route stops immediately when any account or member returns a non-retryable failure; a later account lock cannot replace that terminal response.
76
+
Timeouts, `408`, `429`, `5xx`, and provider/model capability incompatibilities such as an unsupported model can advance fallback. Capability failures do not create account cooldown locks. The per-member timeout defaults to 60 seconds. An explicit route stops immediately on other non-retryable failures; a later account lock cannot replace that terminal response.
77
77
78
78
OAuth providers add an account-pool layer beneath model routing. Accounts receive monotonic, never-reused aliases (`oauth1`, `oauth2`, ...). Model discovery advertises one canonical pooled id such as `chatgpt/gpt-5.4`; account-qualified ids such as `chatgpt/oauth2/gpt-5.4` and legacy stored-account ids remain resolvable but are not advertised. Quota failures create an account-wide lock using provider reset hints when available; authentication and transient failures use shorter model-scoped cooldowns. Early streaming quota events are inspected before the client stream starts so fallback can still occur. Selection, failure, fallback, locked-account skips, and terminal exhaustion are written as structured logs.
79
79
@@ -82,6 +82,7 @@ OAuth providers add an account-pool layer beneath model routing. Accounts receiv
82
82
`src/lib/providers/index.js` selects an adapter by provider type.
-`cloudflare.js` discovers runnable Workers AI models through the paginated `/ai/models/search` API and delegates requests to Cloudflare's OpenAI-compatible chat endpoint.
85
86
-`chatgpt.js` translates chat-completion requests to the ChatGPT Codex Responses surface and normalizes Responses SSE.
86
87
-`claude.js` translates OpenAI messages and tools to Anthropic Messages, applies the current OAuth client contract, and converts JSON/SSE back to OpenAI shapes.
87
88
-`antigravity.js` translates Gemini-style upstream requests and SSE.
0 commit comments