Vector Storage Observability
VectorDB observability: a compression-stats badge, a three-tier storage estimate (Raw/SQ8/PQ), and a GPU-aware search-latency badge.
Vector Storage Observability
The Vector Storage Observability set complements the Storage Meter (quota) with VectorDB-specific observability: a compression-stats badge (SQ8 ratio + before/after size, e.g. "4.0× — 15KB→3.7KB"), a three-tier storage estimate (Raw Float32 / SQ8 4× / PQ 8–32× with the active tier highlighted), and a GPU-aware search-latency badge (accented when WebGPU-accelerated). Values derive from compression stats and search timing, passed in as props (recommended producer: getCompressionStats() / useStorageQuota from @localmode/react, on-device, optional).
Preview
Installation
pnpm dlx shadcn@latest add @localmode/ui/local-first/vector-storage-observabilitynpx shadcn@latest add @localmode/ui/local-first/vector-storage-observabilityyarn dlx shadcn@latest add @localmode/ui/local-first/vector-storage-observabilitybunx --bun shadcn@latest add @localmode/ui/local-first/vector-storage-observabilityData source & dependencies
Data source: renders the compression stats + search timing you pass — works with any backend. Recommended producer: getCompressionStats() and useStorageQuota from @localmode/react (on-device, optional).
@localmode/ui/lib/browser-utils—formatBytesfor the size readouts (installed automatically as a registry dependency)lucide-react— iconsclsx+tailwind-merge— via the sharedcn()util (installed automatically as a registry dependency)
Files installed
vector-storage-observability.tsx— theVectorStorageObservabilitycomponentlib/browser-utils.ts— generic browser helpers (formatBytes)lib/utils.ts— thecn()helper (if not already present)
Props
VectorStorageObservability
Prop
Type
CompressionStatsLike
Prop
Type
Examples
Bound to compression stats
import { getCompressionStats } from '@localmode/core';
const stats = await getCompressionStats(db); // async — returns Promise<CompressionStats>
<VectorStorageObservability
stats={stats}
tier="sq8"
searchLatencyMs={searchMs}
webgpuAccelerated={usedGpu}
/>Customization
The latency badge accents (violet) when webgpuAccelerated is true. The three-tier estimate highlights the tier prop; non-active tiers dim. Styled entirely with shadcn/ui CSS-variable utilities so it inherits your theme — because you own the copied file, every class and threshold is yours to change.
Adaptive Batch Card
Surfaces useAdaptiveBatchSize: a computed optimal batch number, hardware summary, detection source, and collapsible reasoning — with a compact badge variant.
Embedding Drift Banner
A warning shown when the active embedding model is incompatible with stored vectors — with reindex progress, phase, and Re-embed/Cancel.