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

Function connectProviderEntries

packages/web/src/render.tsx:226–249  ·  view source on GitHub ↗
(
  models: Map<string, ModelEntry>,
  providers: ProviderModelEntry[],
)

Source from the content-addressed store, hash-verified

224}
225
226function connectProviderEntries(
227 models: Map<string, ModelEntry>,
228 providers: ProviderModelEntry[],
229) {
230 for (const entry of providers) {
231 if (!entry.canonicalModelId) continue;
232
233 const canonical = models.get(entry.canonicalModelId);
234 if (!canonical) continue;
235
236 entry.canonical = canonical;
237 canonical.providers.push(entry);
238 }
239
240 for (const model of models.values()) {
241 model.providers.sort((a, b) => a.provider.name.localeCompare(b.provider.name));
242 model.minInputCost = minDefined(
243 model.providers.map((provider) => provider.model.cost?.input),
244 );
245 model.minOutputCost = minDefined(
246 model.providers.map((provider) => provider.model.cost?.output),
247 );
248 }
249}
250
251function buildLabEntries(models: Map<string, ModelEntry>) {
252 const labs = new Map<string, ModelEntry[]>();

Callers 1

render.tsxFile · 0.85

Calls 1

minDefinedFunction · 0.85

Tested by

no test coverage detected