Unified Agent + reusable Go agent core.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: add stats model vendor icons

Lyric b616f5d9 ea7c15af

+224 -6
+27
web/console/src/assets/model-vendors/README.md
··· 1 + # Provider Assets 2 + 3 + 这批文件先用于选型和界面预览,不代表每家都已经拿到了完整品牌包。 4 + 5 + - `openai.svg` 6 + - 来源:`https://openai.com/brand/` 7 + - 说明:自动化访问品牌页时被 Cloudflare 拦截;当前文件取自 `openai.com` 官方页面内嵌的 knot SVG。 8 + - `anthropic.png` 9 + - 来源:`https://www.anthropic.com/` 10 + - 实际下载:`https://cdn.prod.website-files.com/67ce28cfec624e2b733f8a52/681d52619fec35886a7f1a70_favicon.png` 11 + - 说明:官网当前公开暴露的是这个小尺寸 mark;之前抓到的那张复杂 SVG 不是合适的品牌主图标,已经去掉。 12 + - `gemini.png` 13 + - 来源:Google 官方产品静态资源 14 + - 实际下载:`https://www.gstatic.com/images/branding/productlogos/gemini_2025/v1/web-24dp/logo_gemini_2025_color_2x_web_24dp.png` 15 + - 说明:当前只定位到公开 PNG,暂未找到同源 SVG。 16 + - `groq.svg` 17 + - 来源:`https://groq.com/favicon.svg` 18 + - `mistral.svg` 19 + - 来源:`https://mistral.ai/brand` 20 + - 实际下载:`https://mistral.ai/img/mistral-ai-logo.svg` 21 + - `deepseek.png` 22 + - 来源:`https://deepseek.com/` 23 + - 实际下载:`https://cdn.deepseek.com/logo.png` 24 + - 说明:当前只定位到公开 PNG,暂未找到官方 SVG;这里保留的是从官网 logo 中裁出的鲸鱼 mark,不带文字。 25 + - `xai.png` 26 + - 来源:`https://x.ai/favicon.ico` 27 + - 说明:公开品牌包链接在当前环境返回 `403`,这里先用官方站点图标转成 PNG 作为占位;`.ico` 文件已移除。
web/console/src/assets/model-vendors/anthropic.png

This is a binary file and will not be displayed.

web/console/src/assets/model-vendors/deepseek.png

This is a binary file and will not be displayed.

web/console/src/assets/model-vendors/gemini.png

This is a binary file and will not be displayed.

+1
web/console/src/assets/model-vendors/groq.svg
··· 1 + <svg xmlns="http://www.w3.org/2000/svg" fill="none" width="33" height="33" viewBox="0 0 33 33"><g clip-path="url(#a)"><path fill="#F43E01" d="M.54.39h32v32h-32z"/><path fill="#fff" d="m18.445 4.406-9.468 13.74 7.341.665-1.69 9.578 9.469-13.74-7.342-.664 1.69-9.579Z"/></g><defs><clipPath id="a"><path fill="#fff" d="M.54.39h32v32h-32z"/></clipPath></defs></svg>
+19
web/console/src/assets/model-vendors/mistral.svg
··· 1 + <svg width="191" height="135" viewBox="0 0 191 135" fill="none" xmlns="http://www.w3.org/2000/svg"> 2 + <g clip-path="url(#clip0_173_337)"> 3 + <path d="M54.3219 0H27.1528V27.0892H54.3219V0Z" fill="#FFD800"/> 4 + <path d="M162.984 0H135.815V27.0892H162.984V0Z" fill="#FFD800"/> 5 + <path d="M81.482 27.0913H27.1528V54.1805H81.482V27.0913Z" fill="#FFAF00"/> 6 + <path d="M162.99 27.0913H108.661V54.1805H162.99V27.0913Z" fill="#FFAF00"/> 7 + <path d="M162.971 54.168H27.1528V81.2572H162.971V54.168Z" fill="#FF8205"/> 8 + <path d="M54.3219 81.2593H27.1528V108.349H54.3219V81.2593Z" fill="#FA500F"/> 9 + <path d="M108.661 81.2593H81.4917V108.349H108.661V81.2593Z" fill="#FA500F"/> 10 + <path d="M162.984 81.2593H135.815V108.349H162.984V81.2593Z" fill="#FA500F"/> 11 + <path d="M81.4879 108.339H-0.00146484V135.429H81.4879V108.339Z" fill="#E10500"/> 12 + <path d="M190.159 108.339H108.661V135.429H190.159V108.339Z" fill="#E10500"/> 13 + </g> 14 + <defs> 15 + <clipPath id="clip0_173_337"> 16 + <rect width="190.141" height="135" fill="white"/> 17 + </clipPath> 18 + </defs> 19 + </svg>
+6
web/console/src/assets/model-vendors/openai.svg
··· 1 + <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 41 41" fill="none"> 2 + <path 3 + fill="currentColor" 4 + d="M37.5324 16.8707C37.9808 15.5241 38.1363 14.0974 37.9886 12.6859C37.8409 11.2744 37.3934 9.91076 36.676 8.68622C35.6126 6.83404 33.9882 5.3676 32.0373 4.4985C30.0864 3.62941 27.9098 3.40259 25.8215 3.85078C24.8796 2.7893 23.7219 1.94125 22.4257 1.36341C21.1295 0.785575 19.7249 0.491269 18.3058 0.500197C16.1708 0.495044 14.0893 1.16803 12.3614 2.42214C10.6335 3.67624 9.34853 5.44666 8.6917 7.47815C7.30085 7.76286 5.98686 8.3414 4.8377 9.17505C3.68854 10.0087 2.73073 11.0782 2.02839 12.312C0.956464 14.1591 0.498905 16.2988 0.721698 18.4228C0.944492 20.5467 1.83612 22.5449 3.268 24.1293C2.81966 25.4759 2.66413 26.9026 2.81182 28.3141C2.95951 29.7256 3.40701 31.0892 4.12437 32.3138C5.18791 34.1659 6.8123 35.6322 8.76321 36.5013C10.7141 37.3704 12.8907 37.5973 14.9789 37.1492C15.9208 38.2107 17.0786 39.0587 18.3747 39.6366C19.6709 40.2144 21.0755 40.5087 22.4946 40.4998C24.6307 40.5054 26.7133 39.8321 28.4418 38.5772C30.1704 37.3223 31.4556 35.5506 32.1119 33.5179C33.5027 33.2332 34.8167 32.6547 35.9659 31.821C37.115 30.9874 38.0728 29.9178 38.7752 28.684C39.8458 26.8371 40.3023 24.6979 40.0789 22.5748C39.8556 20.4517 38.9639 18.4544 37.5324 16.8707ZM22.4978 37.8849C20.7443 37.8874 19.0459 37.2733 17.6994 36.1501C17.7601 36.117 17.8666 36.0586 17.936 36.0161L25.9004 31.4156C26.1003 31.3019 26.2663 31.137 26.3813 30.9378C26.4964 30.7386 26.5563 30.5124 26.5549 30.2825V19.0542L29.9213 20.998C29.9389 21.0068 29.9541 21.0198 29.9656 21.0359C29.977 21.052 29.9842 21.0707 29.9867 21.0902V30.3889C29.9842 32.375 29.1946 34.2791 27.7909 35.6841C26.3872 37.0892 24.4838 37.8806 22.4978 37.8849ZM6.39227 31.0064C5.51397 29.4888 5.19742 27.7107 5.49804 25.9832C5.55718 26.0187 5.66048 26.0818 5.73461 26.1244L13.699 30.7248C13.8975 30.8408 14.1233 30.902 14.3532 30.902C14.583 30.902 14.8088 30.8408 15.0073 30.7248L24.731 25.1103V28.9979C24.7321 29.0177 24.7283 29.0376 24.7199 29.0556C24.7115 29.0736 24.6988 29.0893 24.6829 29.1012L16.6317 33.7497C14.9096 34.7416 12.8643 35.0097 10.9447 34.4954C9.02506 33.9811 7.38785 32.7263 6.39227 31.0064ZM4.29707 13.6194C5.17156 12.0998 6.55279 10.9364 8.19885 10.3327C8.19885 10.4013 8.19491 10.5228 8.19491 10.6071V19.808C8.19351 20.0378 8.25334 20.2638 8.36823 20.4629C8.48312 20.6619 8.64893 20.8267 8.84863 20.9404L18.5723 26.5542L15.206 28.4979C15.1894 28.5089 15.1703 28.5155 15.1505 28.5173C15.1307 28.5191 15.1107 28.516 15.0924 28.5082L7.04046 23.8557C5.32135 22.8601 4.06716 21.2235 3.55289 19.3046C3.03862 17.3858 3.30624 15.3413 4.29707 13.6194ZM31.955 20.0556L22.2312 14.4411L25.5976 12.4981C25.6142 12.4872 25.6333 12.4805 25.6531 12.4787C25.6729 12.4769 25.6928 12.4801 25.7111 12.4879L33.7631 17.1364C34.9967 17.849 36.0017 18.8982 36.6606 20.1613C37.3194 21.4244 37.6047 22.849 37.4832 24.2684C37.3617 25.6878 36.8382 27.0432 35.9743 28.1759C35.1103 29.3086 33.9415 30.1717 32.6047 30.6641C32.6047 30.5947 32.6047 30.4733 32.6047 30.3889V21.188C32.6066 20.9586 32.5474 20.7328 32.4332 20.5338C32.319 20.3348 32.154 20.1698 31.955 20.0556ZM35.3055 15.0128C35.2464 14.9765 35.1431 14.9142 35.069 14.8717L27.1045 10.2712C26.906 10.1554 26.6803 10.0943 26.4504 10.0943C26.2206 10.0943 25.9948 10.1554 25.7963 10.2712L16.0726 15.8858V11.9982C16.0715 11.9783 16.0753 11.9585 16.0837 11.9405C16.0921 11.9225 16.1048 11.9068 16.1207 11.8949L24.1719 7.25025C25.4053 6.53903 26.8158 6.19376 28.2383 6.25482C29.6608 6.31589 31.0364 6.78077 32.2044 7.59508C33.3723 8.40939 34.2842 9.53945 34.8334 10.8531C35.3826 12.1667 35.5464 13.6095 35.3055 15.0128ZM14.2424 21.9419L10.8752 19.9981C10.8576 19.9893 10.8423 19.9763 10.8309 19.9602C10.8195 19.9441 10.8122 19.9254 10.8098 19.9058V10.6071C10.8107 9.18295 11.2173 7.78848 11.9819 6.58696C12.7466 5.38544 13.8377 4.42659 15.1275 3.82264C16.4173 3.21869 17.8524 2.99464 19.2649 3.1767C20.6775 3.35876 22.0089 3.93941 23.1034 4.85067C23.0427 4.88379 22.937 4.94215 22.8668 4.98473L14.9024 9.58517C14.7025 9.69878 14.5366 9.86356 14.4215 10.0626C14.3065 10.2616 14.2466 10.4877 14.2479 10.7175L14.2424 21.9419ZM16.071 17.9991L20.4018 15.4978L24.7325 17.9975V22.9985L20.4018 25.4983L16.071 22.9985V17.9991Z" 5 + /> 6 + </svg>
web/console/src/assets/model-vendors/xai.png

This is a binary file and will not be displayed.

+31
web/console/src/core/model-vendor-prefixes.json
··· 1 + [ 2 + { "prefix": "claude", "vendor": "anthropic" }, 3 + { "prefix": "grok-", "vendor": "xai" }, 4 + { "prefix": "grok", "vendor": "xai" }, 5 + { "prefix": "deepseek-", "vendor": "deepseek" }, 6 + { "prefix": "deepseek", "vendor": "deepseek" }, 7 + { "prefix": "gemini-", "vendor": "gemini" }, 8 + { "prefix": "gemini", "vendor": "gemini" }, 9 + { "prefix": "ministral-", "vendor": "mistral" }, 10 + { "prefix": "mixtral-", "vendor": "mistral" }, 11 + { "prefix": "mistral-", "vendor": "mistral" }, 12 + { "prefix": "mistral", "vendor": "mistral" }, 13 + { "prefix": "pixtral-", "vendor": "mistral" }, 14 + { "prefix": "pixtral", "vendor": "mistral" }, 15 + { "prefix": "codestral-", "vendor": "mistral" }, 16 + { "prefix": "codestral", "vendor": "mistral" }, 17 + { "prefix": "compound-", "vendor": "groq" }, 18 + { "prefix": "compound", "vendor": "groq" }, 19 + { "prefix": "groq-", "vendor": "groq" }, 20 + { "prefix": "groq", "vendor": "groq" }, 21 + { "prefix": "chatgpt-", "vendor": "openai" }, 22 + { "prefix": "gpt-", "vendor": "openai" }, 23 + { "prefix": "codex-", "vendor": "openai" }, 24 + { "prefix": "codex", "vendor": "openai" }, 25 + { "prefix": "o1-", "vendor": "openai" }, 26 + { "prefix": "o1", "vendor": "openai" }, 27 + { "prefix": "o3-", "vendor": "openai" }, 28 + { "prefix": "o3", "vendor": "openai" }, 29 + { "prefix": "o4-", "vendor": "openai" }, 30 + { "prefix": "o4", "vendor": "openai" } 31 + ]
+4 -4
web/console/src/i18n/index.js
··· 772 772 stats_projected_records: "已投影记录", 773 773 stats_skipped_records: "跳过记录", 774 774 stats_requests: "请求数", 775 - stats_input_tokens: "输入 Tokens", 776 - stats_output_tokens: "输出 Tokens", 775 + stats_input_tokens: "输入", 776 + stats_output_tokens: "输出", 777 777 stats_total_tokens: "总 Tokens", 778 - stats_cached_input_tokens: "缓存命中 Tokens", 779 - stats_cache_creation_input_tokens: "缓存写入 Tokens", 778 + stats_cached_input_tokens: "缓存命中", 779 + stats_cache_creation_input_tokens: "缓存写入", 780 780 stats_total_cost: "总费用", 781 781 stats_costs: "费用", 782 782 stats_input_cost: "输入费用",
+40
web/console/src/views/StatsView.css
··· 326 326 overflow-wrap: anywhere; 327 327 } 328 328 329 + .stats-model-ident { 330 + display: flex; 331 + align-items: center; 332 + gap: 10px; 333 + min-width: 0; 334 + } 335 + 336 + .stats-model-vendor-badge { 337 + display: inline-flex; 338 + align-items: center; 339 + justify-content: center; 340 + width: 22px; 341 + min-width: 22px; 342 + height: 22px; 343 + padding: 3px; 344 + border-radius: 999px; 345 + overflow: hidden; 346 + border: 1px solid var(--stats-line-soft); 347 + background: #fff; 348 + flex-shrink: 0; 349 + } 350 + 351 + .stats-model-vendor-badge-fallback { 352 + background: color-mix(in srgb, var(--bg-2) 90%, var(--accent-1) 10%); 353 + } 354 + 355 + .stats-model-vendor-image { 356 + width: 100%; 357 + height: 100%; 358 + object-fit: contain; 359 + display: block; 360 + } 361 + 362 + .stats-model-vendor-fallback { 363 + width: 13px; 364 + min-width: 13px; 365 + height: 13px; 366 + color: var(--stats-muted); 367 + } 368 + 329 369 .stats-request-pill { 330 370 display: inline-grid; 331 371 gap: 3px;
+96 -2
web/console/src/views/StatsView.js
··· 4 4 import AppKicker from "../components/AppKicker"; 5 5 import AppPage from "../components/AppPage"; 6 6 import { endpointState, formatTime, runtimeApiFetch, translate } from "../core/context"; 7 + import modelVendorPrefixes from "../core/model-vendor-prefixes.json"; 8 + import anthropicIcon from "../assets/model-vendors/anthropic.png"; 9 + import deepseekIcon from "../assets/model-vendors/deepseek.png"; 10 + import geminiIcon from "../assets/model-vendors/gemini.png"; 11 + import groqIcon from "../assets/model-vendors/groq.svg"; 12 + import mistralIcon from "../assets/model-vendors/mistral.svg"; 13 + import openaiIcon from "../assets/model-vendors/openai.svg"; 14 + import xaiIcon from "../assets/model-vendors/xai.png"; 15 + 16 + const MODEL_VENDOR_ICONS = { 17 + anthropic: anthropicIcon, 18 + deepseek: deepseekIcon, 19 + gemini: geminiIcon, 20 + groq: groqIcon, 21 + mistral: mistralIcon, 22 + openai: openaiIcon, 23 + xai: xaiIcon, 24 + }; 25 + 26 + const MODEL_VENDOR_LABELS = { 27 + anthropic: "Anthropic", 28 + deepseek: "DeepSeek", 29 + gemini: "Gemini", 30 + groq: "Groq", 31 + mistral: "Mistral", 32 + openai: "OpenAI", 33 + xai: "xAI", 34 + }; 35 + 36 + const MODEL_VENDOR_RULES = Array.isArray(modelVendorPrefixes) 37 + ? [...modelVendorPrefixes] 38 + .filter((item) => item && typeof item.prefix === "string" && typeof item.vendor === "string") 39 + .sort((a, b) => b.prefix.length - a.prefix.length) 40 + : []; 7 41 8 42 function hasMetricValue(totals, key) { 9 43 return Boolean(totals) && Object.prototype.hasOwnProperty.call(totals, key); ··· 276 310 return !hasMetricValue(row, column.key); 277 311 } 278 312 313 + function normalizeModelName(value) { 314 + return String(value || "").trim().toLowerCase(); 315 + } 316 + 317 + function modelMatchCandidates(modelName) { 318 + const normalized = normalizeModelName(modelName); 319 + if (!normalized) { 320 + return []; 321 + } 322 + const candidates = [normalized]; 323 + const slashIndex = normalized.lastIndexOf("/"); 324 + if (slashIndex >= 0 && slashIndex < normalized.length - 1) { 325 + candidates.push(normalized.slice(slashIndex + 1)); 326 + } 327 + return [...new Set(candidates)]; 328 + } 329 + 330 + function modelVendorMeta(modelName) { 331 + const candidates = modelMatchCandidates(modelName); 332 + if (candidates.length === 0) { 333 + return { 334 + vendor: "", 335 + icon: "", 336 + label: "", 337 + }; 338 + } 339 + const matchedRule = candidates 340 + .flatMap((candidate) => MODEL_VENDOR_RULES.filter((item) => candidate.startsWith(item.prefix))) 341 + .sort((a, b) => b.prefix.length - a.prefix.length)[0]; 342 + const vendor = matchedRule?.vendor || ""; 343 + return { 344 + vendor, 345 + icon: vendor ? MODEL_VENDOR_ICONS[vendor] || "" : "", 346 + label: vendor ? MODEL_VENDOR_LABELS[vendor] || vendor : "", 347 + }; 348 + } 349 + 279 350 const StatsView = { 280 351 components: { 281 352 AppKicker, ··· 386 457 modelLedgerTokenColumns, 387 458 formatModelLedgerValue, 388 459 isModelLedgerValueUnavailable, 460 + modelVendorMeta, 389 461 formatNumber, 390 462 }; 391 463 }, ··· 534 606 <tbody> 535 607 <tr v-for="model in host.models" :key="host.api_host + ':' + model.model" class="stats-model-ledger-row"> 536 608 <th scope="row" class="stats-model-ledger-model"> 537 - <code class="stats-model-name">{{ model.model }}</code> 609 + <div class="stats-model-ident"> 610 + <span class="stats-model-vendor-badge" :class="{ 'stats-model-vendor-badge-fallback': !modelVendorMeta(model.model).icon }"> 611 + <img 612 + v-if="modelVendorMeta(model.model).icon" 613 + :src="modelVendorMeta(model.model).icon" 614 + :alt="modelVendorMeta(model.model).label" 615 + class="stats-model-vendor-image" 616 + /> 617 + <QIconCpuChip v-else class="stats-model-vendor-fallback icon" /> 618 + </span> 619 + <code class="stats-model-name">{{ model.model }}</code> 620 + </div> 538 621 </th> 539 622 <td class="stats-model-ledger-value-cell stats-model-ledger-requests">{{ formatNumber(model.requests) }}</td> 540 623 <td ··· 617 700 <tbody> 618 701 <tr v-for="model in visibleModels" :key="model.model" class="stats-model-ledger-row"> 619 702 <th scope="row" class="stats-model-ledger-model"> 620 - <code class="stats-model-name">{{ model.model }}</code> 703 + <div class="stats-model-ident"> 704 + <span class="stats-model-vendor-badge" :class="{ 'stats-model-vendor-badge-fallback': !modelVendorMeta(model.model).icon }"> 705 + <img 706 + v-if="modelVendorMeta(model.model).icon" 707 + :src="modelVendorMeta(model.model).icon" 708 + :alt="modelVendorMeta(model.model).label" 709 + class="stats-model-vendor-image" 710 + /> 711 + <QIconCpuChip v-else class="stats-model-vendor-fallback icon" /> 712 + </span> 713 + <code class="stats-model-name">{{ model.model }}</code> 714 + </div> 621 715 </th> 622 716 <td class="stats-model-ledger-value-cell stats-model-ledger-requests">{{ formatNumber(model.requests) }}</td> 623 717 <td