|
|
@@ -786,28 +786,81 @@ export namespace Config {
|
|
|
})
|
|
|
export type Layout = z.infer<typeof Layout>
|
|
|
|
|
|
- export const Provider = ModelsDev.Provider.partial()
|
|
|
- .extend({
|
|
|
- whitelist: z.array(z.string()).optional(),
|
|
|
- blacklist: z.array(z.string()).optional(),
|
|
|
- models: z
|
|
|
+ export const Model = z
|
|
|
+ .object({
|
|
|
+ id: z.string(),
|
|
|
+ name: z.string(),
|
|
|
+ family: z.string().optional(),
|
|
|
+ release_date: z.string(),
|
|
|
+ attachment: z.boolean(),
|
|
|
+ reasoning: z.boolean(),
|
|
|
+ temperature: z.boolean(),
|
|
|
+ tool_call: z.boolean(),
|
|
|
+ interleaved: z
|
|
|
+ .union([
|
|
|
+ z.literal(true),
|
|
|
+ z
|
|
|
+ .object({
|
|
|
+ field: z.enum(["reasoning_content", "reasoning_details"]),
|
|
|
+ })
|
|
|
+ .strict(),
|
|
|
+ ])
|
|
|
+ .optional(),
|
|
|
+ cost: z
|
|
|
+ .object({
|
|
|
+ input: z.number(),
|
|
|
+ output: z.number(),
|
|
|
+ cache_read: z.number().optional(),
|
|
|
+ cache_write: z.number().optional(),
|
|
|
+ context_over_200k: z
|
|
|
+ .object({
|
|
|
+ input: z.number(),
|
|
|
+ output: z.number(),
|
|
|
+ cache_read: z.number().optional(),
|
|
|
+ cache_write: z.number().optional(),
|
|
|
+ })
|
|
|
+ .optional(),
|
|
|
+ })
|
|
|
+ .optional(),
|
|
|
+ limit: z.object({
|
|
|
+ context: z.number(),
|
|
|
+ input: z.number().optional(),
|
|
|
+ output: z.number(),
|
|
|
+ }),
|
|
|
+ modalities: z
|
|
|
+ .object({
|
|
|
+ input: z.array(z.enum(["text", "audio", "image", "video", "pdf"])),
|
|
|
+ output: z.array(z.enum(["text", "audio", "image", "video", "pdf"])),
|
|
|
+ })
|
|
|
+ .optional(),
|
|
|
+ experimental: z.boolean().optional(),
|
|
|
+ status: z.enum(["alpha", "beta", "deprecated"]).optional(),
|
|
|
+ provider: z.object({ npm: z.string().optional(), api: z.string().optional() }).optional(),
|
|
|
+ options: z.record(z.string(), z.any()),
|
|
|
+ headers: z.record(z.string(), z.string()).optional(),
|
|
|
+ variants: z
|
|
|
.record(
|
|
|
z.string(),
|
|
|
- ModelsDev.Model.partial().extend({
|
|
|
- variants: z
|
|
|
- .record(
|
|
|
- z.string(),
|
|
|
- z
|
|
|
- .object({
|
|
|
- disabled: z.boolean().optional().describe("Disable this variant for the model"),
|
|
|
- })
|
|
|
- .catchall(z.any()),
|
|
|
- )
|
|
|
- .optional()
|
|
|
- .describe("Variant-specific configuration"),
|
|
|
- }),
|
|
|
+ z
|
|
|
+ .object({
|
|
|
+ disabled: z.boolean().optional().describe("Disable this variant for the model"),
|
|
|
+ })
|
|
|
+ .catchall(z.any()),
|
|
|
)
|
|
|
- .optional(),
|
|
|
+ .optional()
|
|
|
+ .describe("Variant-specific configuration"),
|
|
|
+ })
|
|
|
+ .partial()
|
|
|
+
|
|
|
+ export const Provider = z
|
|
|
+ .object({
|
|
|
+ api: z.string().optional(),
|
|
|
+ name: z.string(),
|
|
|
+ env: z.array(z.string()),
|
|
|
+ id: z.string(),
|
|
|
+ npm: z.string().optional(),
|
|
|
+ whitelist: z.array(z.string()).optional(),
|
|
|
+ blacklist: z.array(z.string()).optional(),
|
|
|
options: z
|
|
|
.object({
|
|
|
apiKey: z.string().optional(),
|
|
|
@@ -840,11 +893,14 @@ export namespace Config {
|
|
|
})
|
|
|
.catchall(z.any())
|
|
|
.optional(),
|
|
|
+ models: z.record(z.string(), Model).optional(),
|
|
|
})
|
|
|
+ .partial()
|
|
|
.strict()
|
|
|
.meta({
|
|
|
ref: "ProviderConfig",
|
|
|
})
|
|
|
+
|
|
|
export type Provider = z.infer<typeof Provider>
|
|
|
|
|
|
export const Info = z
|