mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-03 02:11:48 +00:00
fix(dashboard/models): filter empty-string model rows + simplify vendor split
- SQL: add `model != ''` to both queries in /api/analytics/models so sessions with empty-string model (pre-existing data integrity, confirmed in production DB: ~107 sessions) no longer render as blank-header cards. - ModelsPage: drop the arbitrary slashIdx < 20 length gate in shortModelName / modelProvider. The gate was fragile for longer vendor prefixes (e.g. `deepseek-ai/...`). Strip on the first / unconditionally. Rename modelProvider -> modelVendor to avoid confusion with the billing provider column. - scripts/release.py: add AUTHOR_MAP entry for yatesjalex.
This commit is contained in:
parent
e6b05eaf63
commit
113239f6e3
3 changed files with 9 additions and 8 deletions
|
|
@ -38,17 +38,17 @@ function formatCost(n: number): string {
|
|||
return "$0";
|
||||
}
|
||||
|
||||
/** Short model name: strip provider prefix like "openrouter/" or "anthropic/". */
|
||||
/** Short model name: strip vendor prefix like "openrouter/" or "anthropic/". */
|
||||
function shortModelName(model: string): string {
|
||||
const slashIdx = model.indexOf("/");
|
||||
if (slashIdx > 0 && slashIdx < 20) return model.slice(slashIdx + 1);
|
||||
if (slashIdx > 0) return model.slice(slashIdx + 1);
|
||||
return model;
|
||||
}
|
||||
|
||||
/** Extract provider from model string like "openrouter/gemini-2.5-pro" → "openrouter" */
|
||||
function modelProvider(model: string, fallback?: string): string {
|
||||
/** Extract vendor prefix from a model string like "anthropic/claude-opus-4.7" → "anthropic". */
|
||||
function modelVendor(model: string, fallback?: string): string {
|
||||
const slashIdx = model.indexOf("/");
|
||||
if (slashIdx > 0 && slashIdx < 20) return model.slice(0, slashIdx);
|
||||
if (slashIdx > 0) return model.slice(0, slashIdx);
|
||||
return fallback || "";
|
||||
}
|
||||
|
||||
|
|
@ -142,7 +142,7 @@ function ModelCard({
|
|||
rank: number;
|
||||
}) {
|
||||
const { t } = useI18n();
|
||||
const provider = entry.provider || modelProvider(entry.model);
|
||||
const provider = entry.provider || modelVendor(entry.model);
|
||||
const totalTokens = entry.input_tokens + entry.output_tokens;
|
||||
const caps = entry.capabilities;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue