diff options
| author | Frank <[email protected]> | 2025-09-26 15:18:22 -0400 |
|---|---|---|
| committer | Frank <[email protected]> | 2025-09-26 15:18:24 -0400 |
| commit | 57e1bffbd5884ff5be8ad597083610a861709d7a (patch) | |
| tree | 6ef6b6215135093c075fd15aaca06210c519237b /packages/console/core/src | |
| parent | f321661b4c2446dd625adcf874d872bad1e90d51 (diff) | |
| download | opencode-57e1bffbd5884ff5be8ad597083610a861709d7a.tar.gz opencode-57e1bffbd5884ff5be8ad597083610a861709d7a.zip | |
zen: model management helper
Diffstat (limited to 'packages/console/core/src')
| -rw-r--r-- | packages/console/core/src/model.ts | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/packages/console/core/src/model.ts b/packages/console/core/src/model.ts new file mode 100644 index 000000000..028d94655 --- /dev/null +++ b/packages/console/core/src/model.ts @@ -0,0 +1,30 @@ +import { z } from "zod" + +export namespace ZenModel { + const ModelCostSchema = z.object({ + input: z.number(), + output: z.number(), + cacheRead: z.number().optional(), + cacheWrite5m: z.number().optional(), + cacheWrite1h: z.number().optional(), + }) + + export const ModelSchema = z.object({ + cost: ModelCostSchema, + cost200K: ModelCostSchema.optional(), + allowAnonymous: z.boolean().optional(), + providers: z.array( + z.object({ + id: z.string(), + api: z.string(), + apiKey: z.string(), + model: z.string(), + weight: z.number().optional(), + headerMappings: z.record(z.string(), z.string()).optional(), + disabled: z.boolean().optional(), + }), + ), + }) + + export const ModelsSchema = z.record(z.string(), ModelSchema) +} |
