feat(models): add auth profile cooldown for api key pools

This commit is contained in:
William Valentin
2026-02-19 11:45:55 -08:00
parent baa53f91d9
commit 6b56d9e223
9 changed files with 175 additions and 22 deletions
+2 -1
View File
@@ -258,6 +258,7 @@ models:
model: claude-opus-4-5-20251101
api_key: sk-ant-api03-...
# api_keys: [sk-ant-primary-..., sk-ant-secondary-...] # Optional rotation pool
# auth_profile_cooldown_ms: 30000 # Optional cooldown before retrying a failed key profile
local:
provider: ollama
model: qwen2.5:14b
@@ -321,7 +322,7 @@ models:
Each tier can optionally specify `auth_mode` (`auto` | `api_key` | `oauth`) to control whether Flynn uses API keys vs OAuth/token auth for that provider. `use_oauth: true` remains supported as a compatibility alias for `auth_mode: oauth`.
When multiple keys are configured via `api_keys`, Flynn rotates across keys on provider failures and sticks to the last successful key profile until it fails.
When multiple keys are configured via `api_keys`, Flynn rotates across key profiles on provider failures and sticks to the last successful profile until it fails. Set `auth_profile_cooldown_ms` to temporarily cool down failing profiles before retrying them.
Note: with `provider: openai` + `auth_mode: oauth` (Codex backend), Flynn currently does not send tool definitions to the provider. Tool execution is therefore unavailable in that mode, and any textual `tool_use` output should be treated as non-executable model text.