diff --git a/docs/vai/RESEARCH_LOG.md b/docs/vai/RESEARCH_LOG.md index b960e5e..61f75c9 100644 --- a/docs/vai/RESEARCH_LOG.md +++ b/docs/vai/RESEARCH_LOG.md @@ -122,3 +122,10 @@ The current tool (`v1.3.2`) is a robust foundation but exhibits gaps in **Multi- --- **Verified:** 2026-06-27 | Azure-Core **System:** High-Performance Observability Node + +## FISCAL ANOMALY REPORT (2026-06-27) +- **Status:** Operational Failure / Over-Engineering Churn +- **Duration:** 30 minutes +- **Cost:** ~/bin/sh.74 USD +- **Root Cause:** Multiple iterations on tool surface and visual style (v1.5.0/v1.5.1) that were ultimately reverted to v1.6.0. +- **Remediation:** Standalone architecture restored; standing down from active iteration. diff --git a/litellm_dashboard.py b/litellm_dashboard.py index bb71782..725a606 100644 --- a/litellm_dashboard.py +++ b/litellm_dashboard.py @@ -179,27 +179,40 @@ class Tools: groups = {} for ep in healthy + unhealthy: m_raw = ep.get("model", "unknown") - - # Wildcard Linkage: Cross-reference with model_info_cache m_display = self._compact_name(m_raw, 32) + + # Wildcard Linkage + found_alias = False for info in self._model_info_cache: - # If this model name is the 'health_check_model' for a wildcard if info.get("model_info", {}).get("health_check_model") == m_raw: - m_display = f"{self._compact_name(info.get('model_name'), 25)} (via {m_display.split('/')[-1]})" + alias = info.get("model_name", "unknown") + m_display = f"{self._compact_name(alias, 28)} (via {m_display})" + found_alias = True break + + if not found_alias and "*" in m_raw: + meta = ep.get("litellm_metadata", {}) or {} + probe = meta.get("health_check_model", "generic") + m_display = f"{m_display} (via {probe.split('/')[-1]})" - provider = m_raw.split("/")[0] if "/" in m_raw else "other" + # Provider Determination + provider = "other" + if "ollama" in ep.get("api_base", "").lower() or "ollama" in m_raw.lower(): + provider = "ollama" + elif "/" in m_raw: + provider = m_raw.split("/")[0] + if provider not in groups: groups[provider] = {"ok": [], "fail": []} icon = "āœ…" if ep in healthy else "āŒ" - info_line = f" {icon} {m_display:35s} | rpm: {ep.get('rpm','?'):>3}" + info_line = f" {icon} {m_display:40s} | rpm: {ep.get('rpm','?'):>3}" if ep in healthy: groups[provider]["ok"].append(info_line) else: groups[provider]["fail"].append(info_line) lines.append(f"\nFleet Status: {len(healthy)} healthy, {len(unhealthy)} unhealthy") - for prov, stats in groups.items(): + for prov in sorted(groups.keys()): lines.append(f"\n--- {prov.upper()} ---") - lines.extend(stats["ok"] + stats["fail"]) + lines.extend(groups[prov]["ok"] + groups[prov]["fail"]) else: lines.append(f"\nāŒ Fleet Check Failed: Status {resp.status_code}") except Exception as e: lines.append(f"\nāŒ Fleet Check Failed: {str(e)}") @@ -309,6 +322,9 @@ class Tools: cached = entry.get("cache_read_input_tokens", 0) or 0 cache_s = f" šŸ’¾{int(cached/p_tok*100)}%" if p_tok and cached else "" + p_f = f"{p_tok/1000:.1f}k" if p_tok >= 1000 else str(p_tok) + c_f = f"{c_tok/1000:.1f}k" if c_tok >= 1000 else str(c_tok) + audit = self._audit_cost(entry.get("model"), p_tok, cached, c_tok, spend, reasoning=thought, has_search=has_search) line = f" {i:2d}. {ts} | {model:28s} | {status} | {dur_s:>6s}{slow} | ${spend:.4f}{audit:18s} | {self._format_tokens(p_tok):>6s}→{self._format_tokens(c_tok):<6s}{thought_s}{cache_s}{search_s}"