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

Function fetchModels

packages/core/src/sync/providers/huggingface.ts:81–90  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

79 ];
80 },
81 async fetchModels() {
82 const headers = process.env.HF_TOKEN
83 ? { Authorization: `Bearer ${process.env.HF_TOKEN}` }
84 : undefined;
85 const response = await fetch(API_ENDPOINT, { headers });
86 if (!response.ok) {
87 throw new Error(`Hugging Face models request failed: ${response.status} ${response.statusText}`);
88 }
89 return response.json();
90 },
91 parseModels(raw) {
92 return HuggingFaceResponse.parse(raw).data;
93 },

Callers

nothing calls this directly

Calls 1

fetchFunction · 0.50

Tested by

no test coverage detected