A customer asks about a refund and gets the billing guide first. The request succeeds, and the error log is quiet. That is the kind of failure you can get when you replace only the query embedding model: equal vector length does not mean equal meaning along each direction.
When moving from EmbeddingGemma 300M to 2 on Workers AI, the usual choice is to re-embed source documents and switch the query encoder and index as a pair. Even at 768 dimensions, check whether the right document comes back, not just whether the request succeeds.
01 · What ended on November 20?
Cloudflare's retirement notice says requests to the listed models fail with HTTP 410 and product error 5028 starting November 20, 2026. The list includes @cf/google/embeddinggemma-300m. The November 12 release note introduced its replacement, @cf/google/embeddinggemma-2, on Workers AI. This is what the provider announced, not a live API outage we reproduced.
The new model docs specify 768 dimensions by default, or 128, 256, or 512 for shorter vectors. Query and document roles differ; the model examples show suitable prefixes for query text and document titles and bodies. A shared space across input types within one model says nothing about compatibility with the previous model's vectors.
Vectorize index settings fix dimension count and similarity metric at creation. A 512-element vector is the wrong shape for a 768-dimension index. A 768-element vector from a different model can be the right shape and still produce wrong results.
02 · A same-size counterexample that changes every correct answer
Use three documents, for returns, shipping, and billing, and three queries with one correct document each. The old space uses three unit vectors. The new space permutes every vector as (a,b,c) → (b,c,a). The change preserves cosine and ranking when each space is used consistently, but a comparison across spaces pairs directions with different meanings.
| Query / documents | Top-1: returns | Top-1: shipping | Top-1: billing | Correct |
|---|---|---|---|---|
| old / old | returns | shipping | billing | 3/3 |
| new / new | returns | shipping | billing | 3/3 |
| new / old | billing | returns | shipping | 0/3 |
Figure 1. In the synthetic 3D test, either matched pair found 3 of 3 answers. New queries against old documents found 0 of 3. This is not a model benchmark.
This was one deterministic run on Python 3.12.14. New queries against old documents return the wrong result first, with cosine similarity 1. A separate wrong-length input is rejected by the local example's guard, not by a live Vectorize API call.
from math import sqrt ids = ("returns", "shipping", "billing") old = [(1,0,0), (0,1,0), (0,0,1)] new = [(b,c,a) for a,b,c in old] def cosine(a,b): if len(a) != len(b): raise ValueError("different dimensions") return sum(x*y for x,y in zip(a,b)) / ( sqrt(sum(x*x for x in a))*sqrt(sum(y*y for y in b))) def top1(queries, docs): return [ids[max(range(len(docs)), key=lambda i: cosine(q, docs[i]))] for q in queries] for name,queries,docs,expected in ( ("old/old",old,old,ids), ("new/new",new,new,ids), ("new/old",new,old,("billing","returns","shipping")), ): result = top1(queries,docs) assert tuple(result) == expected print(name, result, sum(a==b for a,b in zip(ids,result)), "/ 3") try: cosine((1,0), old[0]) except ValueError as e: print("mismatch:", e) else: raise AssertionError("expected the local dimension guard") 03 · When an index rebuild isn't enough, or isn't needed
For an infrastructure-only move with the same model, output size, metric, and preprocessing version, verify index integrity and known-answer queries before rebuilding for its own sake. For a new model without established compatibility, as in this migration, leave the spaces separate even at 768 dimensions. Moving to 512 dimensions is a separate change to evaluate for quality and cost.
Vectorize upsert replaces the vector with the same ID, and writes become visible asynchronously. Replacing vectors in place can leave a mixed index during the rebuild. Populate a separate index, check the expected IDs and deletions against the source snapshot, and verify the new data is actually queryable. If the corpus changes while you rebuild, also catch up changes since the snapshot.
Figure 2. Re-embed the source, validate the new index, then switch its query encoder and index together. Keep a working fallback if the old encoder is retired.
04 · Make retrieval pass before switching models
- Write down real questions and expected matches. Mix clear intents with near-duplicates and the languages users actually search in. Have people label the right documents before looking at the new ranking.
- Test the new pair in isolation. Embed documents and queries with the new setup. Count which labeled answers appear in the top five, confirm critical questions still return the right content, and verify read visibility and latency against your own service requirements. If you didn't save a baseline, use human labels rather than depending on a call to a retired model.
- Switch the query encoder and index together. If the old encoder is retired, an old index alone is not a usable rollback. Keep a working fallback such as keyword search or help links. If the source documents are missing, use that fallback until you recover or recollect them instead of guessing how to transform the old vectors.
This synthetic run proves that a shape check is not a compatibility check. It measures neither real EmbeddingGemma ranking nor quality at 512 dimensions, and it does not measure Vectorize latency. The release gate should be whether your questions still find your documents.
AI generated this article and its illustrations. The evidence and reproduction were checked.

