MCPcopy
hub / github.com/anomalyco/models.dev / loadExistingModel

Function loadExistingModel

packages/core/script/generate-helicone.ts:62–68  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

60}
61
62async 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
70function pickEndpoint(m: z.infer<typeof ModelItem>) {
71 if (!m.endpoints || m.endpoints.length === 0) return undefined;

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected