Open History to see the last commit
1// Brand words the provider icon already shows. A label that opens with one of
2// them leads with the model family and version instead, e.g. "Opus 5.5".
3const ICON_BRAND_PREFIXES = ["Anthropic", "Claude", "Google", "OpenAI", "Meta", "Microsoft", "xAI"];
4
5/** Label for a model shown beside its provider icon, without the redundant brand. */
6export function modelLabelBesideIcon(label: string): string {
7 let rest = label.trim();
8 for (;;) {
9 const brand = ICON_BRAND_PREFIXES.find(
10 (prefix) => rest.startsWith(`${prefix} `) && rest.length > prefix.length + 1,
11 );
12 if (!brand) return rest;
13 rest = rest.slice(brand.length + 1).trimStart();
14 }
15}