Deterministic diagnostic reporting engine for LLM runtime systems.
Lighthouse analyzes aggregated runtime metrics and produces a ranked, structured diagnostic report.
It helps answer:
-
Why did latency increase? -
Why is cost rising? -
Which bottlenecks have the highest impact? -
What should we investigate first?
This is post-execution analytics only. It does not block traffic, enforce budgets, or mutate runtime behavior.
What Problem This Solves
When operating LLM systems in production, teams face:
-
Latency spikes without clear root cause -
Token throughput instability -
Rising cost without structured explanation -
CPU and queue saturation -
Too many metrics, no prioritization
Dashboards show data. They do not rank problems.
Lighthouse converts aggregated metrics into:
-
Detected anomalies -
Classified bottlenecks -
Impact scores -
Top-3 prioritized recommendations -
Structured guidance -
Self-debug plan -
Exportable Markdown report
npm installnpm run buildnpm run testnpm run example(prints a sample diagnostic report)
import { createLighthouse } from "openclaw-lighthouse-diagnostic-skill";
const lh = createLighthouse();
const metrics = lh.metrics.collect({
capitalVelocity: 10,
tokenThroughputPerMin: 200,
avgResponseTimeMs: 800,
successCount: 20,
blockRate: 0.05,
queueDepth: 3,
cpuLoadPct: 45,
allocationBreakdown: { scale: 0.2, maintain: 0.7, kill: 0.1 },
});
const anomalies = lh.anomalyDetector.detect(metrics, 0.07);
const recs = lh.remedy.recommend(0.07, anomalies);Consumes JSONL logs shaped as:
{ requestId, model, promptTokens, completionTokens, totalTokens, cost, latencyMs, environment, blocked, blockReason, timestamp }
Feed these to your own pipeline, then pass aggregates to Lighthouse analyzers. Lighthouse will not mutate or block traffic.
avgResponseTimeMs> 30s: Local LLM or hardware queue likely congested; inspect GPU/queue first.tokenThroughputPerMinspike: possible runaway loop; pair with cost/ops logs to confirm.queueDepthandcpuLoadPctgive immediate visibility on saturation.
- Use
NotebookLMPack.exportto generate Markdown in/reports. - Feed the file into NotebookLM to ask for product comparisons or strategy ideas.
- Packs include Blueprint, PRD, pains, and Product DNA (structured JSON block).
- Latency breach → Recommend
MAINTAINwith note to inspect GPU/queue. - Token spike → Recommend
KILL(circuit breaker). validationScore < 0.05→ RecommendKILLwith reason.- No anomalies →
MAINTAIN.
src/monitoring:MetricsCollector,TokenWatchersrc/diagnostic:AnomalyDetector,RemedyLogicsrc/exporters:MarkdownGenerator,NotebookLMPacksrc/domain: report typesreports/: generated outputs (local-first)tests/: adversarial/unit coverage for metrics, anomaly, exporters
- Deterministic only: no AI heuristics for safety decisions.
- Local-first: outputs to JSON/Markdown under
/reports. - Read-only to core systems: does not mutate scoring/budget, does not enforce or block requests.