devtools.codes

Embedding Cost Estimator

RUNS LOCALLY

Work out what embedding a corpus will cost before you index it, from the number of documents, their average size and your provider’s rate. It also prompts for the thing most estimates omit: how many times you will re-embed everything after changing chunk size or switching model.

Your tool input is processed locally in your browser and is not intentionally uploaded to our servers. Advertising and analytics providers may still process normal page, device, cookie and network information.

How to use the Embedding Cost Estimator

  1. Enter how many documents you plan to index, and how large an average one is.
  2. Choose characters or tokens. Characters are approximated at four per token and labelled as such.
  3. Enter the rate from your provider’s pricing page, per million tokens.
  4. Set index passes above one if you expect to re-embed, which most projects do at least once.

A worked example, and what it shows

The example is ten thousand documents averaging four thousand characters, embedded twice. Two passes rather than one is the realistic case: almost every project re-embeds after a chunking change or an extraction fix.

The single-pass figure and the total are shown separately, so the cost of the second pass is visible rather than buried. Advisories name what the estimate excludes — vector storage, and the queries you will embed at search time, which is usually the part that grows.

Press Example in the workspace above to load it.

Common questions about the Embedding Cost Estimator

Why does this ask about re-indexing?

Because almost nobody embeds a corpus only once, and single-pass estimates are the usual reason a budget is wrong. Changing chunk size, switching embedding model, or fixing a text-extraction bug all mean re-embedding everything. Budgeting two or three passes is more realistic than one.

Does this include the cost of searching?

No, and that gap matters. Indexing is a one-off cost you can calculate; query embedding is ongoing and grows with usage. For a busy application the queries eventually cost more than the corpus did. Estimate them separately, using expected searches per month rather than document count.

How accurate is the character-to-token conversion?

Reasonable for English prose and unreliable for anything else. Code, markup and non-Latin scripts all run denser, sometimes by half again, so a corpus of source files will cost more than this suggests. If the figure matters, count a representative sample with your provider’s own tokeniser and enter tokens directly instead.

Why do I enter the rate by hand?

Because embedding prices change and vary by model, and a figure hard-coded here would eventually be wrong without anyone noticing. Copying it from the provider’s pricing page takes a moment and means the number you get out reflects what you will actually be charged.

Does my input leave the browser?

No. Your tool input is processed locally in your browser and is not intentionally uploaded to our servers. Advertising and analytics providers may still process normal page, device, cookie and network information. Only the counts you type are used, and they are not sent anywhere.