@remit/search-index-worker 0.0.25 → 0.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index-report.ts +30 -0
package/package.json
CHANGED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { formatIndexProvenance } from "@remit/search-service";
|
|
2
|
+
import { buildEmbeddingServiceFromEnv } from "@remit/search-service/from-env";
|
|
3
|
+
import { readSqliteIndexProvenance } from "@remit/search-service/sqlite-vec";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* `remit check-index` (#455): which embedder wrote the vectors that are in the
|
|
7
|
+
* index, counted against the one this deployment is configured with.
|
|
8
|
+
*
|
|
9
|
+
* An alternate entrypoint in the search-index-worker image — the same shape the
|
|
10
|
+
* backend's `migrate.mjs` has — rather than an image or a service of its own. It
|
|
11
|
+
* belongs in this image because this is where the configured embedder resolves:
|
|
12
|
+
* the weight precision is part of the embedding identity and is set in this
|
|
13
|
+
* image, so the same environment read from any other container names a model
|
|
14
|
+
* that never wrote a vector here.
|
|
15
|
+
*
|
|
16
|
+
* Reads the vector store and writes nothing.
|
|
17
|
+
*/
|
|
18
|
+
const path = process.env.LOCAL_VECTORDB_PATH;
|
|
19
|
+
if (!path) {
|
|
20
|
+
process.stderr.write(
|
|
21
|
+
"LOCAL_VECTORDB_PATH is unset, so this deployment keeps no vector index on disk and there is nothing to report.\n",
|
|
22
|
+
);
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const report = await readSqliteIndexProvenance({
|
|
27
|
+
path,
|
|
28
|
+
configuredEmbeddingId: buildEmbeddingServiceFromEnv().embeddingId,
|
|
29
|
+
});
|
|
30
|
+
process.stdout.write(formatIndexProvenance(report));
|