reembed-verify

command
v0.12.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 17 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package main is a read-only diagnostic for an embedding-model rename.

When the configured embedding model string changes (e.g. graduating "google/gemini-embedding-2-preview" → "google/gemini-embedding-2"), the startup re-embed (internal/rag/reembed.go) re-generates every stored vector because the `embedding_version` tag no longer matches. This tool answers, WITHOUT touching the DB, three questions that the in-place re-embed can't:

  • identity: is the new model the same vector space? It re-embeds each row's content and reports the cosine(old, new) distribution.
  • speed: wall time at a given --parallelism / --batch, so we can size the real migration and experiment with faster knobs.
  • cost: prompt tokens consumed (+ a $ estimate via --price-per-1m).

It reuses the production internal/llm client so provider routing and request shape match the real re-embed path. Nothing is written back.

Usage:

go run ./cmd/reembed-verify --db data/prod/laplaced.db
go run ./cmd/reembed-verify --parallelism 16 --batch 64 --limit 500

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL