From 55a6fcdd3f5b3c55712e5cfc9dd4d994da38d4c8 Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Wed, 28 May 2025 12:53:22 -0400 Subject: add provider_list --- js/src/app/config.ts | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) (limited to 'js/src/app') diff --git a/js/src/app/config.ts b/js/src/app/config.ts index 947298c67..77a1f606f 100644 --- a/js/src/app/config.ts +++ b/js/src/app/config.ts @@ -1,25 +1,34 @@ import path from "node:path"; import { Log } from "../util/log"; import { z } from "zod"; +import { LLM } from "../llm/llm"; export namespace Config { const log = Log.create({ service: "config" }); + export const Model = z.object({ + name: z.string().optional(), + cost: z.object({ + input: z.number(), + inputCached: z.number(), + output: z.number(), + outputCached: z.number(), + }), + contextWindow: z.number(), + maxTokens: z.number(), + attachment: z.boolean(), + }); + export type Model = z.output; + + export const Provider = z.object({ + options: z.record(z.string(), z.any()).optional(), + models: z.record(z.string(), Model).optional(), + }); + export type Provider = z.output; + export const Info = z .object({ - providers: z - .object({ - anthropic: z - .object({ - apiKey: z.string().optional(), - headers: z.record(z.string(), z.string()).optional(), - baseURL: z.string().optional(), - }) - .strict() - .optional(), - }) - .strict() - .optional(), + providers: z.record(z.string(), Provider).optional(), }) .strict(); -- cgit v1.2.3