MCPcopy Index your code
hub / github.com/anomalyco/models.dev / buildProviderModelEntries

Function buildProviderModelEntries

packages/web/src/render.tsx:197–224  ·  view source on GitHub ↗
(models: Map<string, ModelEntry>)

Source from the content-addressed store, hash-verified

195}
196
197function buildProviderModelEntries(models: Map<string, ModelEntry>) {
198 const entries: ProviderModelEntry[] = [];
199
200 for (const [providerId, provider] of Object.entries(Providers)) {
201 for (const [modelId, model] of Object.entries(provider.models)) {
202 if (model.status === "alpha") continue;
203
204 const canonicalModelId = resolveCanonicalModelId(
205 models,
206 providerId,
207 modelId,
208 );
209
210 entries.push({
211 providerId,
212 provider,
213 modelId,
214 model,
215 canonicalModelId,
216 });
217 }
218 }
219
220 return entries.sort((a, b) =>
221 a.provider.name.localeCompare(b.provider.name) ||
222 displayModelName(a).localeCompare(displayModelName(b)),
223 );
224}
225
226function connectProviderEntries(
227 models: Map<string, ModelEntry>,

Callers 1

render.tsxFile · 0.85

Calls 2

resolveCanonicalModelIdFunction · 0.85
displayModelNameFunction · 0.85

Tested by

no test coverage detected