When re-embedding a 40-million-chunk retrieval corpus under a provider's tokens-per-minute limit or on your own accelerators, how do you estimate wall-clock time and spend?
answer
- tokens, not chunks
- the new model's tokenizer
- only the spare share of the limit
- slowest stage sets the clock
basics
~20 sCount the corpus in the new model's input tokens, divide by the throughput you can really use (the spare rate-limit share or measured accelerator rate), and check the store's write rate; spend is tokens times price, or accelerator-hours times rate.
solid answer
~50 sI start from input tokens, not chunks, and count them with the *new* model's tokenizer, because two tokenizers can split the same text quite differently. In the scenario, 40M chunks at about 400 tokens is 16 billion tokens. Against a tokens-per-minute limit I count only the share left after live traffic, say 5M, so 16B / 5M = 3,200 minutes, about 53 hours before retries. On my own accelerators I benchmark chunks per second on a real batch: at 1,000 per second that is about 11 accelerator-hours. Then I check the other ceilings, such as a requests-per-minute or per-day cap and the vector store's write and index-build rate, because the slowest stage sets the wall-clock. Spend is tokens times price (16,000M tokens at a scenario $0.02 per million is about $320) or accelerator-hours times rate, plus a second copy of storage during cutover.
go deeper
Remember that hosted embedding services usually limit and bill calls in input tokens, so a backfill estimate starts from the corpus's token count, not its chunk or document count.
Walk the arithmetic out loud: sampled tokens per chunk, total tokens, spare tokens per minute, hours, then spend. Say which tokenizer you counted with and why it must be the new model's.
Name every ceiling, including requests per minute, a daily cap and the store's write and index rate, and show which one binds on a provider versus on your own accelerators.
Frame the estimate as an input to the staging plan: what a temporary limit increase, self-run capacity or deduplication buys in days, and when a few hundred dollars of embedding is the least of the cost.
## What you are actually sizing A **re-embedding backfill** recomputes the vector of every chunk in a retrieval corpus under a new embedding model (or a new chunker) while the old vectors keep serving queries. Before anyone approves it, someone has to answer two questions: how long will it run, and what will it cost. Both are derived from the same few numbers, and the usual mistake is to start from the wrong one. ## Count in the new model's input tokens The unit every limit and every price is written in is the **input token**, not the chunk and not the document. So the estimate starts with a token count: - **Sample, then extrapolate.** Tokenize a random sample of a few thousand chunks and multiply the mean by the chunk count. A full count is cheap too, if the tokenizer can run locally. - **Use the new model's tokenizer.** Two models can split the same text into noticeably different numbers of tokens, especially code, tables, long identifiers and non-Latin scripts. Reusing the old model's counts can understate the job. - **Include everything that is sent.** If the pipeline prepends a title or a context line to each chunk before embedding, those tokens are billed and rate-limited too. ## The throughput you can really use | Path | Ceiling | How you find it | |---|---|---| | Hosted provider | the tokens-per-minute share left after live query and ingestion traffic; often a requests-per-minute limit and sometimes a per-day cap as well | your account's published limits, then a short trial run | | Own accelerators | measured chunks per second per accelerator at your real chunk lengths and batch size | a benchmark on a representative batch, not a vendor figure | | Either | the vector store's sustainable write and index-build rate | a sample load of a few million vectors | The backfill only gets the **spare** share of a provider limit: live queries and fresh ingestion still need theirs, and how a team splits one quota across workloads is covered with batching and concurrency control. The slowest of the three rows sets the wall-clock. ## Worked numbers (a scenario's figures) 1. **Tokens.** 40,000,000 chunks at a sampled mean of 400 input tokens is 16,000,000,000 tokens. 2. **Provider wall-clock.** With 5,000,000 tokens per minute to spare, 16,000,000,000 / 5,000,000 = 3,200 minutes, about 53 hours of embedding before retries. 3. **Provider spend.** At a scenario price of $0.02 per million input tokens, 16,000 million tokens cost about $320. 4. **Own accelerators.** At a measured 1,000 chunks per second per accelerator, 40,000,000 / 1,000 = 40,000 seconds, about 11.1 accelerator-hours; at a scenario $2.50 an hour that is about $28, and eight accelerators finish the compute in about 1.4 hours. 5. **The store.** If the vector store sustains 5,000 vector writes per second with its index kept current, 40,000,000 / 5,000 = 8,000 seconds, about 2.2 hours, which now sets the self-run wall-clock. 6. **Storage.** At 1,024 dimensions of 4-byte floats, one copy of the vectors is 40,000,000 x 4,096 bytes, about 164 GB before index overhead, and the cutover keeps two copies for a while. Add a margin, often a few percent, for retries, rejected inputs and re-runs of failed batches. ## What shortens it - **Embed each distinct text once.** Boilerplate footers and templated pages repeat; keyed by a hash of the exact text sent, identical chunks can share one embedding call under the same model. - **Drop dead weight first.** Chunks of deleted documents and orphaned rows should not be re-embedded at all. - **Ask for more limit or move the work.** A temporary limit increase, a provider's bulk interface where one exists (choosing it is covered with batching), or self-run accelerators all raise the ceiling. - **Stage it by tenant.** A per-tenant cutover lets the first tenants switch long before the last chunk is done. ## What the estimate leaves out The figures above are the **job**. They do not include the engineering time to build the resumable runner, the second copy of storage during cutover, or the index build if the store builds its graph after the load. A per-embedding unit figure for accounting is a separate calculation, and so is deciding whether the new model was worth adopting; this estimate starts once that call is made.
- Why can the same corpus take longer to re-embed under the new model even at an unchanged tokens-per-minute limit?The new tokenizer may count more tokens for the same text, so the same limit moves fewer chunks per minute. A larger model also runs slower on your own hardware, a bigger vector dimension slows store writes, and a requests-per-minute limit can bind first if the new model accepts smaller batches. Re-measure on a sample before trusting the old run's duration.
- When does the vector store, rather than the embedding step, set a backfill's wall-clock?Usually on self-run accelerators, where embedding is fast and cheap, and whenever the store keeps an approximate index current on every write. Writing tens of millions of vectors at the store's sustainable rate can take longer than computing them. Load a few million vectors as a trial, measure the rate with the index kept current, and size the job against the slower of the two.
- Divide the chunk count by the requests-per-minute limit and call that the estimate.
- Token counts depend only on the text, so the old model's counts carry over.
- Plan to run the backfill at the full rate limit while production keeps querying.
- Embedding spend is the whole cost; storage and the index build come free.
- Self-run accelerators make the vector store's write rate irrelevant.