MCPcopy Create free account
hub / github.com/anomalyco/models.dev / fetchModels

Function fetchModels

packages/core/src/sync/providers/llmgateway.ts:51–60  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49 name: "LLM Gateway",
50 modelsDir: "providers/llmgateway/models",
51 async fetchModels() {
52 const headers = process.env.LLMGATEWAY_API_KEY
53 ? { Authorization: `Bearer ${process.env.LLMGATEWAY_API_KEY}` }
54 : undefined;
55 const response = await fetch(API_ENDPOINT, { headers });
56 if (!response.ok) {
57 throw new Error(`LLM Gateway request failed: ${response.status} ${response.statusText}`);
58 }
59 return response.json();
60 },
61 parseModels(raw) {
62 return LLMGatewayResponse.parse(raw).data.filter((model) => {
63 const output = model.architecture.output_modalities;

Callers

nothing calls this directly

Calls 1

fetchFunction · 0.50

Tested by

no test coverage detected