Indexing is stuck across the board, or playground returns errors mentioning vector
dimensions. Tail of storage/logs/laravel.log shows:
Vectorize POST indexes/X/upsert failed:
{"code":40012,"message":"invalid vector for id=\"…\",
expected 768 dimensions, and got 1024 dimensions"}
The Cloudflare Vectorize index was provisioned at one dimension (say 768) but the
embedding model now returns vectors of a different size (1024). Most common cause:
operator switched CLOUDFLARE_EMBED_MODEL from @cf/baai/bge-base-en-v1.5
(768 dim) to @cf/baai/bge-m3 or @cf/baai/bge-large-en-v1.5 (both 1024 dim)
without recreating the index.
Pitchbar ships a single-command recovery flow. SSH to your server and run:
cd /path/to/pitchbar
php artisan vector:rebuild-index
Answer yes at the prompt. The command:
Chunk row.Source to status = pending.IndexDocumentJob for every Document with persisted text.
Watch the queue worker — the Knowledge view will refill as each document
re-embeds. URL-only Documents need a manual Reindex click after rebuild
(they re-crawl via CrawlPageJob on demand).
Pitchbar maps these embedding model slugs to dim automatically — leave
VECTOR_DIM env unset and the
EmbedModelDimensions resolver picks
the right value:
| Model | Dim |
|---|---|
@cf/baai/bge-small-en-v1.5 | 384 |
@cf/baai/bge-base-en-v1.5 (default) | 768 |
@cf/baai/bge-large-en-v1.5 | 1024 |
@cf/baai/bge-m3 | 1024 |
text-embedding-3-small (OpenAI) | 1536 |
text-embedding-3-large (OpenAI) | 3072 |
text-embedding-ada-002 (OpenAI) | 1536 |
--force — skip the confirmation prompt (useful for automation / CI rollouts)--dim=N — override the auto-resolved dim (advanced; only if you point at an
unlisted model)
Cloudflare Vectorize indexes are immutable at the dimension level. Once provisioned
with config.dimensions = 768, you cannot resize it in place; you must
drop and recreate. Pitchbar adds two layers of defence so this doesn't bite the
operator silently:
VectorizeClient::upsertPoints and
::search (added 2026-05-15/16) rejects mismatched vectors locally
with an actionable message naming the vector:rebuild-index command —
before paying for a Cloudflare round-trip that would just return 40006 / 40012.
Both pathways funnel the operator to the same recovery: run vector:rebuild-index.
Re-embedding the entire knowledge base counts against Workers AI / OpenAI usage. For
typical CodeCanyon-scale buyers (under 1000 chunks), Cloudflare Workers AI's free tier
covers it. For OpenAI buyers, expect ~$0.02 per 1M tokens with text-embedding-3-small;
a 100-chunk knowledge base is well under $0.01.