feat: add per-tier fallback field to model config schema
Each model tier (fast, default, complex, local) can now specify an optional fallback provider config that the router will try before falling through to the global fallback chain. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -18,7 +18,7 @@ const serverSchema = z.object({
|
||||
auth_http: z.boolean().default(true),
|
||||
});
|
||||
|
||||
const modelConfigSchema = z.object({
|
||||
const modelConfigBaseSchema = z.object({
|
||||
provider: z.enum(['anthropic', 'openai', 'gemini', 'ollama', 'llamacpp', 'openrouter', 'bedrock', 'github']),
|
||||
model: z.string(),
|
||||
endpoint: z.string().optional(),
|
||||
@@ -29,6 +29,10 @@ const modelConfigSchema = z.object({
|
||||
context_window: z.number().optional(),
|
||||
});
|
||||
|
||||
const modelConfigSchema = modelConfigBaseSchema.extend({
|
||||
fallback: modelConfigBaseSchema.optional(),
|
||||
});
|
||||
|
||||
const modelsSchema = z.object({
|
||||
local: modelConfigSchema.optional(),
|
||||
fast: modelConfigSchema.optional(),
|
||||
|
||||
Reference in New Issue
Block a user