Replies: 1 comment
-
|
| Backend | External Embedding (Nomic/Ollama) | Embedding Source |
|---|---|---|
sqlite_vec |
✅ Works | Ollama / vLLM / TEI |
cloudflare |
❌ Blocked | Workers AI (bge-base-en-v1.5) |
hybrid |
❌ Blocked | Local ONNX/SentenceTransformer + Workers AI |
The Blocker Is Architectural, Not Dimensional
Interestingly, the dimensions actually match: both Nomic-embed-text (768) and Cloudflare Workers AI bge-base-en-v1.5 (768) produce 768-dimensional vectors. This means that if the Cloudflare backend were refactored to accept external embeddings, Nomic vectors would be dimensionally compatible with the existing Vectorize index.
The real blocker is purely architectural: the Cloudflare Worker code calls Workers AI directly for embeddings, and there is no hook to substitute an external embedding source.
Note: The dimension mismatch only exists between the default local ONNX model (all-MiniLM-L6-v2, 384-dim) and Nomic (768-dim) — relevant when switching models on the sqlite_vec backend (requires re-embedding all memories).
Recommendation
For users on the hybrid backend (recommended for production), Nomic-embed-text is not a viable option today. The path forward would be:
- Option A: Refactor the Cloudflare backend to accept external embeddings via API — the matching 768 dimensions mean Nomic vectors could slot into the existing Vectorize index without re-indexing
- Option B: Use Nomic only in
sqlite_vecmode and accept no cloud sync - Option C: Wait for Cloudflare to support custom embedding models in Workers AI
Option A is more feasible than initially thought, precisely because the dimensions already align. The refactor would primarily involve routing embedding generation through an external API instead of Workers AI, while keeping the Vectorize storage layer unchanged.
This should be documented more prominently in the external embeddings guide.
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Context
With external embedding API support merged (PR #386) and the embedding migration script available (#556), I benchmarked nomic-embed-text via Ollama against the default SentenceTransformer (all-MiniLM-L6-v2) on an M-series Mac.
Benchmark Results
Latency
Embedding Dimensions
scripts/maintenance/migrate_embeddings.pySimilarity Quality
Observation: Nomic is strong on broad semantic similarity but weaker on domain-specific technical terms. The BM25 hybrid search (enabled by default, 0.3/0.7 weights) effectively compensates by catching exact keyword matches.
Cost
Configuration
Recommendation
Nomic-embed-text is a viable local alternative — faster than API calls, zero cost, decent quality. The dimension mismatch (768 vs 384) means migration is required. Best time to switch: during a major version upgrade or when re-embedding is needed anyway.
The already-active BM25 hybrid search compensates for embedding model weaknesses on exact keyword matches regardless of which model you use.
Questions for the Community
Beta Was this translation helpful? Give feedback.
All reactions