Skip to content

Commit 0a19b2a

Browse files
committed
Make provider pricing schema permissive to avoid startup failures
Add .passthrough().nullable() to pricing Zod schemas so that non-standard pricing encodings (null, extra fields, etc.) from OpenAI-compatible backends don't cause listSchema.parse to throw and abort model loading.
1 parent ba881b8 commit 0a19b2a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/lib/server/models.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ const modelConfig = z.object({
4747
supports_tools: z.boolean().optional(),
4848
pricing: z
4949
.object({ input: z.number().optional(), output: z.number().optional() })
50+
.passthrough()
51+
.nullable()
5052
.optional(),
5153
})
5254
.passthrough()
@@ -110,6 +112,8 @@ const listSchema = z
110112
input: z.number().optional(),
111113
output: z.number().optional(),
112114
})
115+
.passthrough()
116+
.nullable()
113117
.optional(),
114118
})
115119
.passthrough()

0 commit comments

Comments
 (0)