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

Function providerPageMetadata

packages/web/src/render.tsx:516–550  ·  view source on GitHub ↗
(
  providerId: string,
  provider: CatalogProvider,
  models: ProviderModelEntry[],
)

Source from the content-addressed store, hash-verified

514}
515
516function providerPageMetadata(
517 providerId: string,
518 provider: CatalogProvider,
519 models: ProviderModelEntry[],
520): PageMetadata {
521 const title = `${provider.name} models, pricing, and API docs | Models.dev`;
522 const labs = new Set<string>();
523 for (const entry of models) {
524 if (entry.canonical?.labName) labs.add(entry.canonical.labName);
525 }
526 const labNames = [...labs];
527 const labSummary =
528 labNames.length > 1
529 ? `models from labs like ${labNames.slice(0, 3).join(", ")}`
530 : labNames.length === 1 && labNames[0] !== provider.name
531 ? `models from ${labNames[0]}`
532 : undefined;
533 const description = compactMetadataDescription(
534 [
535 `Browse ${plural(models.length, `${provider.name} model`)} on Models.dev.`,
536 factSentence([
537 labSummary,
538 `pricing`,
539 `context windows`,
540 `capabilities`,
541 `SDK package ${provider.npm}`,
542 provider.api ? `API endpoint and docs` : `provider docs`,
543 ]),
544 `Provider ID: ${providerId}.`,
545 ],
546 280,
547 );
548
549 return { title, description };
550}
551
552function labPageMetadata(lab: LabEntry): PageMetadata {
553 const title = `${lab.name} models, providers, and specs | Models.dev`;

Callers 1

buildPagesFunction · 0.85

Calls 3

pluralFunction · 0.85
factSentenceFunction · 0.85

Tested by

no test coverage detected