Cold semantic index build delays first Find Anything query by 47–52 seconds

Open
#142 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
machine-learning, numpy, python

Research direction

Start with the Find Anything semantic-index build and the embeddings.lazy_text_model configuration, then trace the NPZ cache and startup-warmup paths. Reproduce the first-query delay on the described CPU-only CLIP setup and compare it with subsequent queries and warmup behavior. Done means the cold-start path no longer makes the initial request wait for the full index build, with timings documenting the improvement.

Written by the indexing model from the issue text.

Description

needs-triage
Environment

Environment: Keystone v0.1.5, native Debian 13 installations, UNVR with Protect 7.4.114. Tested on a multilingual-search fork at 0daad0cba2e86db6041fc44df09bd562524e4276, based on upstream 48d1168b07867032c4ba684c56f02d048ec8a9ea. Not yet reproduced on an unmodified current upstream checkout.

CPU-only CLIP ViT-L/14 FP32, two inference threads, default lazy text model loading.

Observed

First search on i5-1220P took approximately 47 seconds; subsequent searches took approximately 30–170 ms. On i5-4250U:

Building CLIP semantic index for 5375 Protect RAM tags (one-time cache)...
Loaded CLIP text encoder text_model.onnx in 1.41s (provider=CPUExecutionProvider, load #1)
Semantic Find Anything index ready: 5375 RAM tags (built & cached in 52.24s)
Find Anything NL_PARSE query='red jacket' -> visual='red jacket' objectTypes=['person'] keyTags=1 semantic=True (52365ms)
Expected

The initial query should ideally avoid waiting for the entire cold index build, particularly if it risks exceeding Protect's request deadline (not measured).

Notes

The upstream code already supports a persistent NPZ cache and startup warmup via embeddings.lazy_text_model: false. These mitigations have not yet been tested across restarts in this setup. Reporting the observed cold-start cost as a performance improvement opportunity, not requesting a specific implementation.

Dominant language
Python
Stars
1k
Forks
114
Avg merge
1h
Merged PRs (30d)
115

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from seeARMS/keystone

All issues in seeARMS/keystone

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.