(filePath: string)
| 60 | } |
| 61 | |
| 62 | async function loadExistingModel(filePath: string): Promise<ExistingModel | undefined> { |
| 63 | const file = Bun.file(filePath); |
| 64 | if (!(await file.exists())) return undefined; |
| 65 | return await import(filePath, { with: { type: "toml" } }).then( |
| 66 | (mod) => mod.default as ExistingModel, |
| 67 | ); |
| 68 | } |
| 69 | |
| 70 | function pickEndpoint(m: z.infer<typeof ModelItem>) { |
| 71 | if (!m.endpoints || m.endpoints.length === 0) return undefined; |