Inference Queue Monitor
Per-queue inference observability: pending, active, completed, failed, and average latency per registered queue, with live active and destructive failed accents.
Inference Queue Monitor
The Inference Queue Monitor renders one card per registered inference queue showing all five queue metrics — pending, active, completed, failed, and average latency. Non-zero active counts get a live accent (plus a pulsing "active" badge on the queue header), non-zero pending counts are highlighted, and non-zero failed counts render destructive. With no queues registered it shows an empty state pointing at registerQueue(). Stats are passed in as props — works with any backend (recommended producer: useDevToolsQueueStats from @localmode/devtools/react, whose snapshot spreads straight into queues).
Preview
Installation
pnpm dlx shadcn@latest add @localmode/ui/devtools/inference-queue-monitornpx shadcn@latest add @localmode/ui/devtools/inference-queue-monitoryarn dlx shadcn@latest add @localmode/ui/devtools/inference-queue-monitorbunx --bun shadcn@latest add @localmode/ui/devtools/inference-queue-monitorData source & dependencies
Data source: renders the per-queue stats record you pass — works with any backend. Recommended producer: useDevToolsQueueStats from @localmode/devtools/react (on-device, optional) — its Record<string, QueueStats> snapshot matches queues field-for-field, no mapping layer needed.
lucide-react— iconsclsx+tailwind-merge— via the sharedcn()util (installed automatically as a registry dependency)
Files installed
inference-queue-monitor.tsx— theInferenceQueueMonitorcomponentlib/utils.ts— thecn()helper (if not already present)
Props
InferenceQueueMonitor
Prop
Type
QueueStatsLike
Prop
Type
Examples
Wired to the LocalMode devtools bridge
Enable devtools once, register each queue you create, then feed the hook's snapshot straight into the monitor:
import { createInferenceQueue } from '@localmode/core';
import { enableDevTools, registerQueue } from '@localmode/devtools';
import { useDevToolsQueueStats } from '@localmode/devtools/react';
import { InferenceQueueMonitor } from '@/components/inference-queue-monitor';
// Once, at app init
enableDevTools();
// Wherever queues are created
const queue = createInferenceQueue({ concurrency: 1 });
registerQueue('embeddings', queue);
// The monitoring surface
function QueuePanel() {
const queues = useDevToolsQueueStats();
return <InferenceQueueMonitor queues={queues} />;
}Any backend
queues is just a record of per-queue counters — feed it from your own scheduler, a server metrics endpoint, or a test fixture:
<InferenceQueueMonitor
queues={{
transcode: { pending: 3, active: 1, completed: 87, failed: 0, avgLatencyMs: 640 },
}}
/>Customization
Active counts accent emerald (with a pulsing header badge while active > 0), pending counts accent amber, and failed counts use the theme's destructive token. Average latency renders as milliseconds below one second and seconds above. Styled entirely with shadcn/ui CSS-variable utilities so it inherits your theme — because you own the copied file, every class, accent color, and threshold is yours to change.
DevTools
Local-AI observability surfaces — queue, event, pipeline, and model-cache monitors that render @localmode/devtools hook snapshots (or any backend's data) with zero @localmode dependencies.
Event Log Viewer
Newest-first devtools event log with relative timestamps, namespace-colored type badges, a substring type filter, a visible cap with overflow line, and dual empty states.