Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .changes/logo-coverage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "minor",
"summary": "The model catalog supports attributed models.dev logos, LobeHub logo variants, and model family marks across the directories and details."
}
206 changes: 206 additions & 0 deletions .sync/upstream-state.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Install the locked dependencies with Node.js 22+ and `pnpm install --frozen-lock

Use `schema = 2` in catalog records. Use lowercase ASCII letters, digits, dots, underscores and hyphens in path segments. Start each segment with a letter or digit, avoid trailing dots and Windows device names such as `con`, `nul`, `com1` and `lpt1`. The catalog also supports nested safe listing paths for provider IDs that contain slashes. Preserve punctuation such as colons in `provider_model_id`.

Use strict RFC 3986 ASCII URIs in URL fields and percent-encode Unicode path components. Use a slug from the pinned `@lobehub/icons-static-svg` dependency in `icon`. Supply positive integers for limits and omit unknown or inapplicable limits. Record official references with `[[sources]]` entries or header comments. A meaningful `checked_at` date is allowed for sources. Avoid ingestion timestamps and commit hashes in TOML.
Use strict RFC 3986 ASCII URIs in URL fields and percent-encode Unicode path components. Use the base slug from the pinned `@lobehub/icons-static-svg` dependency in `icon`. For brands without a LobeHub mark, use a sanitized models.dev asset in `logos/upstream/`. Supply positive integers for limits and omit unknown or inapplicable limits. Record official references with `[[sources]]` entries or header comments. A meaningful `checked_at` date is allowed for sources. Avoid ingestion timestamps and commit hashes in TOML.

Before opening a data PR, run the same checks as the fast CI job.

Expand All @@ -28,6 +28,6 @@ Run `pnpm check`, the catalog checks above, and the SDK contract and Playwright

## Review synchronization

The sync workflow combines models.dev provider data with LMSpeed model specifications. It compares the last imported upstream baseline, the checked-in TOML and the new upstream values. Routine updates share the `automation/sync-catalog` branch. An outlier or a competing edit gets a `needs-review` PR with its reasons and, for conflicts, the base, current and incoming values. Review the proposed value against the source and edit the PR if the catalog should keep the human correction.
The sync workflow combines models.dev provider data with LMSpeed model specifications. It compares the last imported upstream baseline, the checked-in TOML and the new upstream values. Synchronization updates upstream SVGs using their stored content hashes and preserves locally edited files. Routine updates share the `automation/sync-catalog` branch. An outlier or a competing edit gets a `needs-review` PR with its reasons and, for conflicts, the base, current and incoming values. Review the proposed value against the source and edit the PR if the catalog should keep the human correction.

Run `pnpm sync --out <empty-directory>` from a checkout with committed catalog edits to generate the same patches locally. The GitHub App publisher uses the `automation` environment, whose App needs repository Contents and Pull requests read/write permissions. Enable auto-merge in the repository and require the `required` check.
4 changes: 2 additions & 2 deletions NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## models.dev

Developer, model and provider metadata includes content from [anomalyco/models.dev](https://github.com/anomalyco/models.dev).
Developer, model and provider metadata and sanitized SVGs in `logos/upstream/` include content from [anomalyco/models.dev](https://github.com/anomalyco/models.dev). Upstream logos are included when the pinned LobeHub package has no matching brand.

MIT License

Expand Down Expand Up @@ -32,7 +32,7 @@ LMSpeed-owned source metadata is licensed under [CC BY 4.0](https://creativecomm

## LobeHub Icons

LobeHub icon slugs refer to the MIT-licensed [@lobehub/icons-static-svg](https://github.com/lobehub/lobe-icons) package. SVG assets are extracted from the pinned dependency at build time.
LobeHub icon slugs refer to the MIT-licensed [@lobehub/icons-static-svg](https://github.com/lobehub/lobe-icons) package. Logo variants are extracted from the pinned dependency at build time.

MIT License

Expand Down
31 changes: 29 additions & 2 deletions apps/site/public/licenses/logos.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Logo attribution

Pinned dependency: @lobehub/icons-static-svg 1.105.0, source commit 4c3783f951738710c2c1b8808edb5c8e1d2b91b6.
Pinned dependency: @lobehub/icons-static-svg 1.106.0.
Source: https://github.com/lobehub/lobe-icons

No LobeHub SVG or source is vendored in this repository. Required SVG files are extracted from the locked dependency at build time. Brand marks do not imply official endorsement. Supplementary assets must list their source and redistribution license in sources.json. The default icon is LMSpeed original work under MIT.
No LobeHub SVG or source is vendored in this repository. Required SVG files are extracted from the locked dependency at build time. Brand marks do not imply official endorsement. The default icon is LMSpeed original work under MIT.

MIT License

Expand All @@ -26,3 +26,30 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

## models.dev

Sanitized SVGs in logos/upstream/ are imported from anomalyco/models.dev.
Source: https://github.com/anomalyco/models.dev

MIT License

Copyright (c) 2025 models.dev

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
13 changes: 10 additions & 3 deletions apps/site/src/components/Catalogue.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
import '@fontsource-variable/noto-sans';
import { type Locale, localePath, locales, markdownPath, messages, type Section, siteUrl } from '../lib/catalogue';
import { colorIcons, monoIcons, plateIcons, plateSlugs } from '../lib/directory-data';
import { glyphs } from '../lib/glyphs';
import '../styles/catalogue.css';
import DevelopersDirectory from './DevelopersDirectory.astro';
Expand Down Expand Up @@ -45,7 +46,12 @@ const github = 'https://github.com/LMSpeed/models';
{locales.map(language => <link rel="alternate" hreflang={language} href={`${siteUrl}${localePath(language, section)}`} />)}
<link rel="alternate" hreflang="x-default" href={`${siteUrl}${localePath('en', section)}`} />
</head>
<body>
<body
data-color-icons={[...colorIcons].join(' ')}
data-mono-icons={[...monoIcons].join(' ')}
data-plate-icons={[...plateIcons].join(' ')}
data-plate-slugs={[...plateSlugs].join(' ')}
>
<svg width="0" height="0" class="glyph-library" aria-hidden="true">
{Object.entries(glyphs).map(([name, shape]) => <symbol id={`glyph-${name}`} viewBox="0 0 24 24" set:html={shape} />)}
</svg>
Expand Down Expand Up @@ -115,13 +121,14 @@ const github = 'https://github.com/LMSpeed/models';
<LocaleLinks locale={locale} section={section} />
<button class="icon-button" type="button" data-close aria-label={t.close}><Icon name="close" size={20} /></button>
</div>
<div class="drawer-body">
<div class="drawer-body" tabindex="-1">
<div class="drawer-heading">
<span class="logo" id="detail-logo" hidden></span>
<span id="detail-logo" hidden></span>
<div><h2 id="detail-title">{t.loading}</h2>
<div class="identity-line"><code id="detail-id"></code><button type="button" class="button copy" id="detail-copy" data-copy="">{t.copy}</button></div>
</div>
</div>
<div id="detail-logos" hidden></div>
<div id="detail-content"></div>
</div>
</dialog>
Expand Down
6 changes: 5 additions & 1 deletion apps/site/src/components/DevelopersDirectory.astro
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ const t = messages[locale];
const sorted = [...developers].sort((a, b) => a.name.localeCompare(b.name, locale, { numeric: true }));
---
<Directory locale={locale} section="developers" count={developers.length}>
<colgroup slot="columns" class="developer-columns">
<col class="col-dev-name" /><col class="col-dev-models" /><col class="col-dev-providers" />
<col class="col-dev-weights" /><col class="col-dev-released" /><col class="col-dev-desc" />
</colgroup>
<TableHead initial="name" columns={[
['name', t.developer], ['models', t.models, 'number'], ['providers', t.providers, 'number'],
['weights', t.openWeights, 'number'], ['released', t.latestRelease, 'date'], ['description', t.descriptionLabel],
Expand All @@ -23,7 +27,7 @@ const sorted = [...developers].sort((a, b) => a.name.localeCompare(b.name, local
<tr data-entry data-search={[name, id, description].join(' ')}>
<th scope="row" data-value={name}>
<a class="entity-link entity-with-logo" href={href} aria-label={name} data-detail="developer" data-id={id}>
<Logo icon={icon} size={20} />
<Logo icon={icon} name={name} size={20} />
<span><span class="entity-name" title={name}>{name}</span><code class="entity-id">{id}</code></span>
</a>
</th>
Expand Down
17 changes: 9 additions & 8 deletions apps/site/src/components/Directory.astro
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,21 @@ const filter = { models: t.filterModels, providers: t.filterProviders, developer
<main class="page-scroll" id="directory" tabindex="-1">
<h1 class="sr-only">{t[section]}</h1>
<form id="filters" class="toolbar" aria-label={filter}>
<div class="toolbar-line">
<p class="directory-count" role="status">
<strong id="result-count">{displayNumber(count, locale)}</strong> {t[`${section}Label`]}
</p>
<div class="toolbar-primary">
<label class="filter-search">
<Icon name="search" />
<Icon name="search" size={15} />
<span class="sr-only">{filter}</span>
<input type="search" name="q" placeholder={filter} autocomplete="off" />
<kbd data-shortcut aria-hidden="true">Ctrl K</kbd>
</label>
<slot name="quick" />
</div>
<div class="toolbar-secondary">
<slot name="filters" />
<button class="quiet clear" type="reset">{t.clear}</button>
<button class="quiet clear" type="reset" hidden>{t.clear}</button>
<p class="directory-count" role="status">
<strong id="result-count">{displayNumber(count, locale)}</strong> {t[`${section}Label`]}
</p>
</div>
<slot name="quick" />
</form>
<!-- biome-ignore lint/a11y/noNoninteractiveTabindex: The table scroll region must be keyboard reachable. -->
<section id={section} class:list={['table-scroll', section]} tabindex="0" aria-label={t[section]}>
Expand Down
12 changes: 9 additions & 3 deletions apps/site/src/components/Logo.astro
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
---
import { logoUrl } from '../lib/catalogue';
import { entityMonogram, squareLogoTone, squareLogoUrl } from '../lib/catalogue';
import { colorIcons, monoIcons, plateIcons } from '../lib/directory-data';

interface Props {
icon?: string;
name: string;
size: number;
}
const { icon, size } = Astro.props;
const { icon, name, size } = Astro.props;
const src = squareLogoUrl(icon, colorIcons);
const tone = src ? squareLogoTone(icon, monoIcons, plateIcons) : undefined;
---
<span class="logo"><img src={logoUrl(icon)} width={size} height={size} alt="" loading="lazy" decoding="async" /></span>
<span class:list={['logo', { 'logo-monogram': !src }]} data-tone={tone} style={`--logo-size: ${size}px`} aria-hidden="true">
{src ? <img src={src} width={size} height={size} alt="" loading="lazy" decoding="async" /> : entityMonogram(name)}
</span>
11 changes: 7 additions & 4 deletions apps/site/src/components/ModelsDirectory.astro
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,17 @@ const orderedDevelopers = [...developers].sort((a, b) => a.name.localeCompare(b.
return (
<tr data-entry data-search={[model.name, model.id, developer.name, ...(aliasesByModel.get(model.id) ?? [])].join(' ')} data-type={model.type} data-modality={modalities.join(' ')} data-by={id} data-weights={weights}>
<th scope="row" data-value={model.name}>
<a class="entity-link" href={href} aria-label={model.name} data-detail="model" data-id={model.id}>
<span class="entity-name" title={model.name}>{model.name}</span>
<code class="entity-id" title={model.id}>{model.id}</code>
<a class="entity-link entity-with-logo" href={href} aria-label={model.name} data-detail="model" data-id={model.id}>
<Logo icon={model.icon} name={model.name} size={20} />
<span>
<span class="entity-name" title={model.name}>{model.name}</span>
<code class="entity-id" title={model.id}>{model.id}</code>
</span>
</a>
</th>
<td data-value={developer.name}>
<a class="developer-link" href={detailPath(locale, 'developer', id)} data-detail="developer" data-id={id}>
<Logo icon={developer.icon} size={16} />
<Logo icon={developer.icon} name={developer.name} size={16} />
<span title={developer.name}>{developer.name}</span>
</a>
</td>
Expand Down
6 changes: 5 additions & 1 deletion apps/site/src/components/ProvidersDirectory.astro
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ const t = messages[locale];
const sorted = [...providers].sort((a, b) => a.name.localeCompare(b.name, locale, { numeric: true }));
---
<Directory locale={locale} section="providers" count={providers.length}>
<colgroup slot="columns" class="provider-columns">
<col class="col-provider" /><col class="col-count" /><col class="col-types" />
<col class="col-api" /><col class="col-sdk" /><col class="col-docs" />
</colgroup>
<TableHead initial="name" columns={[
['name', t.provider], ['models', t.models, 'number'], ['types', t.typesLabel],
['api', 'API'], ['sdk', t.sdk], ['docs', t.docsLink],
Expand All @@ -29,7 +33,7 @@ const sorted = [...providers].sort((a, b) => a.name.localeCompare(b.name, locale
<tr data-entry data-search={[provider.name, provider.id, endpoint, sdk, ...types].join(' ')}>
<th scope="row" data-value={provider.name}>
<a class="entity-link entity-with-logo" href={href} aria-label={provider.name} data-detail="provider" data-id={provider.id}>
<Logo icon={provider.icon} size={20} />
<Logo icon={provider.icon} name={provider.name} size={20} />
<span><span class="entity-name" title={provider.name}>{provider.name}</span><code class="entity-id">{provider.id}</code></span>
</a>
</th>
Expand Down
29 changes: 25 additions & 4 deletions apps/site/src/lib/catalogue-controls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ import {
} from './catalogue';
import {
renderDeveloper,
renderLogoVariants,
renderModel,
renderProvider,
setupProviderListings,
} from './details';
import { element } from './element';
import { loadSearchIndex, logoImage, setupSearch } from './search-controls';
import { loadSearchIndex, logoTile, setupSearch } from './search-controls';
import { setupFilter, setupTable } from './table-controls';

const locale = document.documentElement.lang as Locale;
Expand All @@ -24,6 +25,7 @@ const detailKind = element<HTMLElement>(document, '#detail-kind');
const detailTitle = element<HTMLElement>(document, '#detail-title');
const detailId = element<HTMLElement>(document, '#detail-id');
const detailLogo = element<HTMLElement>(document, '#detail-logo');
const detailLogos = element<HTMLElement>(document, '#detail-logos');
const detailCopy = element<HTMLButtonElement>(document, '#detail-copy');
const detailContent = element<HTMLElement>(document, '#detail-content');
let detailRequest: AbortController | undefined;
Expand Down Expand Up @@ -72,18 +74,33 @@ async function openDrawer(kind: DetailKind, id: string) {
detailCopy.textContent = t.copy;
detailLogo.hidden = true;
detailLogo.replaceChildren();
detailLogos.hidden = true;
detailLogos.replaceChildren();
const progress = document.createElement('p');
progress.setAttribute('role', 'status');
progress.textContent = t.loading;
detailContent.replaceChildren(progress);
show(drawer);
drawer.querySelector('.drawer-body')?.scrollTo(0, 0);
const body = drawer.querySelector<HTMLElement>('.drawer-body');
body?.scrollTo(0, 0);
body?.focus({ preventScroll: true });

function render(name: string, icon: string | undefined, html: string) {
detailTitle.textContent = name;
detailLogo.replaceChildren(logoImage(icon, 28));
detailLogo.replaceChildren(logoTile(icon, name, 28));
detailLogo.hidden = false;
detailContent.innerHTML = html;
if (icon && icon !== 'default') {
void renderLogoVariants(icon, locale)
.then((variants) => {
if (request.signal.aborted || !variants) return;
detailLogos.innerHTML = variants;
detailLogos.hidden = false;
})
.catch(() => {
// Reopening the drawer retries the independent logo index request.
});
}
}

try {
Expand Down Expand Up @@ -164,6 +181,7 @@ const pills = Array.from(
form.querySelectorAll<HTMLButtonElement>('button[data-type]'),
);
const type = form.querySelector<HTMLSelectElement>('select[name=type]');
const clearButton = form.querySelector<HTMLButtonElement>('button.clear');
const count = element<HTMLElement>(form, '#result-count');
const empty = element<HTMLElement>(main, '#empty-state');
const { rows, sort } = setupTable(table, locale, (key, direction) => {
Expand Down Expand Up @@ -194,6 +212,8 @@ const filter = setupFilter(
(matches) => {
count.textContent = matches.toLocaleString(locale);
empty.hidden = matches > 0;
const hasFilter = fields.some((field) => Boolean(fieldValue(field)));
if (clearButton) clearButton.hidden = !hasFilter;
for (const pill of pills)
pill.setAttribute(
'aria-pressed',
Expand Down Expand Up @@ -316,7 +336,8 @@ async function copy(button: HTMLButtonElement) {
if (button.dataset.copy === value) button.textContent = t.copyFailed;
}
window.setTimeout(() => {
if (button.dataset.copy === value) button.textContent = t.copy;
if (button.dataset.copy === value)
button.textContent = button.dataset.copyLabel ?? t.copy;
}, 1600);
}

Expand Down
43 changes: 41 additions & 2 deletions apps/site/src/lib/catalogue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,47 @@ export const siteUrl = 'https://models.lmspeed.net';
export const modelPath = (id: string) => `/v2/models/${id}.json`;
export const providerPath = (id: string) => `/v2/providers/${id}.json`;
export const developerId = (id: string) => id.split('/')[0];
export const logoUrl = (icon = 'default') =>
`/v2/logos/${encodeURIComponent(icon)}.svg`;
export type LogoTone = 'mono' | 'color' | 'plate';

export function squareLogoUrl(
icon: string | undefined,
colorIcons: ReadonlySet<string>,
) {
if (!icon || icon === 'default') return;
const slug = colorIcons.has(icon) ? `${icon}-color` : icon;
return `/v2/logos/${encodeURIComponent(slug)}.svg`;
}

export function squareLogoTone(
icon: string | undefined,
monoIcons: ReadonlySet<string>,
plateIcons: ReadonlySet<string>,
): LogoTone {
if (!icon || icon === 'default') return 'mono';
if (monoIcons.has(icon)) return 'mono';
if (plateIcons.has(icon)) return 'plate';
return 'color';
}

export function entityMonogram(name: string): string {
const tokens =
name
.normalize('NFKC')
.replace(/(\p{Lu})(\p{Lu}\p{Ll})/gu, '$1 $2')
.replace(/([\p{Ll}\p{N}])(\p{Lu})/gu, '$1 $2')
.match(/[\p{L}\p{N}]+/gu) ?? [];
const initials = tokens
.slice(0, 2)
.map((token) => [...token][0])
.join('');
const eastAsian =
/^[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u;
const letters =
tokens.length === 1 && eastAsian.test(tokens[0])
? [...tokens[0]].slice(0, 2).join('')
: initials;
return [...letters.toUpperCase()].slice(0, 2).join('') || '?';
}
export const missing = '–';

export function detailPath(locale: Locale, kind: DetailKind, id: string) {
Expand Down
Loading
Loading