EmbeddingGemma‑2’s 768‑dimensional vectors are not a drop‑in for the retired 300M model

Cloudflare · EmbeddingGemma-2: Cloudflare retired EmbeddingGemma-300M, requiring developers to rebuild indexes for EmbeddingGemma-2.

Cloudflare announced that requests to the @cf/google/embeddinggemma-300m model will return HTTP 410 from 20 Nov 2026, and that the new @cf/google/embeddinggemma-2 model, released on 12 Nov, outputs 768‑dimensional embeddings, requiring developers to recreate their vector indexes rather than simply swapping model identifiers.

Retirement notice and new model options

According to the Cloudflare retirement notice, any call to the older model now fails with product error 5028, confirming that the model is no longer available for production use. The replacement model ships with a default dimension count of 768, but also supports reduced sizes of 128, 256 or 512 if a developer explicitly requests a shorter vector.

Cloudflare’s Vectorize documentation explains that an index’s dimension size is fixed at creation and must match the dimensionality of every incoming vector. The docs give an example of creating an index for a 768‑dimensional model such as @cf/baai/bge-base-en-v1.5, showing that dimension mismatches cause API rejections.

Why same‑size vectors aren’t interchangeable

The migration guide points out that vector length alone tells nothing about the meaning of each axis. A synthetic test in the source article demonstrates that the new model permutes the coordinates of a unit‑vector basis (a,b,c) → (b,c,a). Though the dimensionality remains three, cosine similarity between a new query vector and an old document vector can be maximal (value 1) while the semantic match is incorrect.

When the new 768‑dimensional vectors are fed into an index built for the old 300M model, the index accepts the shape but returns unrelated documents, confirming that shape validation is insufficient for semantic compatibility.

Recommended migration workflow

To avoid mixed‑result indexes, the author advises rebuilding the entire vector store: first re‑embed every source document with EmbeddingGemma‑2, then create a fresh index whose dimension matches the chosen vector size. Cloudflare’s docs note that once an index is created its configuration – dimension count and distance metric – cannot be altered, so a new index is mandatory for a dimension change.

After populating the new index, developers should run a suite of known‑answer queries (real user questions with expected document matches) to confirm that top‑k results still align with expectations. If the old model has been retired, a fallback such as keyword search or static help links must be retained until the new embeddings are verified.

The guide also cautions against partial updates: Vectorize upserts replace vectors asynchronously, which can leave a transient state where old and new vectors coexist in the same index, further corrupting ranking. Using a separate index for testing isolates the migration risk.

Why the migration matters for production services

Developers building search‑oriented services on Cloudflare Workers AI rely on embedding consistency to preserve relevance and latency guarantees. Switching to EmbeddingGemma‑2 without re‑embedding can produce perfect‑score cosine matches that are semantically wrong, leading to user‑facing misinformation and higher support costs. Moreover, larger vector dimensions increase storage size and query latency; choosing a reduced 512‑dimensional setting may improve performance but requires separate quality testing because the model’s representation changes. The retirement of the 300M model also removes any possibility of rolling back to the same index, making a fallback to non‑vector retrieval essential during the transition. Teams that treat vector shape as a drop‑in cue risk deploying broken search pipelines, especially in regulated or customer‑support contexts where answer accuracy is critical.

Editorial graphic and headline text by Signal Titans.

Source: EmbeddingGemma 2 still outputs 768 dimensions. Can you reuse the old index? · Create indexes · Cloudflare Vectorize docs

Share this article
FacebookThreadsLinkedInX

Leave a Reply

Your email address will not be published. Required fields are marked *