Skip to content

Add index --dry-run to preview chunks and estimated cost #63

Description

@ssrajadh

Problem

Users have no way to preview what sentrysearch index will do before paying for API calls or kicking off a long local-model run. The chunking math is already available — sentrysearch/chunker.py:118 expected_chunk_spans() returns the spans without splitting any files.

Suggested fix

Add a --dry-run flag to the index command. When set, scan the directory, compute spans per file, and print a per-file summary plus a total. No API calls, no local model loaded, no files written.

Cost estimate math is already documented in the README "Cost" section (1 frame/sec billed for Gemini at $0.00079/frame). Use that to estimate for the Gemini backend. For local/qwen-cloud, just print chunk counts without a dollar estimate.

Example output:

front_2024-01-15_14-30.mp4   4 chunks (120s)
left_2024-01-15_14-30.mp4    4 chunks (120s)
---
8 chunks total, ~240s of footage
Estimated Gemini cost (upper bound): ~\$0.19
Note: still-frame skipping is on by default — real cost will be lower for
parked/Sentry footage. Pass --no-skip-still to bill every frame.

Out of scope

  • Estimated indexing time for the local backend. Throughput depends on the contributor's GPU and quantization; dry-run has no way to measure that without loading the model, which defeats the "zero work" premise. Runtime estimation belongs in sentrysearch benchmark (Add sentrysearch benchmark to collect local-backend hardware reports #68), which calibrates on the user's actual hardware.
  • Accurate still-frame accounting. Dry-run can't know the skip ratio without decoding frames. Print the Gemini estimate as an upper bound and call out the skip behavior in the output (as shown above).

Acceptance

  • sentrysearch index <dir> --dry-run makes zero API calls and does not load any model.
  • Output shows per-file chunk counts and a total.
  • For the Gemini backend, output includes an estimated cost using the README formula, labeled as an upper bound, with a note about still-frame skipping.
  • A test in tests/test_cli.py that uses the existing chunker fixtures and asserts no embedder is constructed.

Scope

sentrysearch/cli.py index command, plus a test. The chunker work is already done.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions