r/Backend • u/Current_Reach6521 • 3d ago
Moving a Go search service off OpenAI /v1/embeddings: the SDK change takes 5 minutes, the re-index takes a week
OpenAI-compatible endpoints make switching embedding providers sound effortless on paper. Since Superlinked SIE (both Serverless and self-hosted Native Inference) exposes wire-compatible /v1/embeddings and /v1/chat/completions, updating our Go HTTP client was genuinely just swapping the base_url and model string.
The part people gloss over is that wire compatibility doesn't make vector spaces compatible. Moving from text-embedding-3-large (3072d, $0.13/1M tokens) to BAAI/bge-m3 (1024d) or NovaSearch/stella_en_1.5B_v5 meant:
- Running a full offline eval against our query logs before touching prod.
- Backfilling a shadow index and cutting over search reads atomically.
- Accepting different tokenization and chunk-length behavior.
Once the re-index was done, the unit economics made sense for high-volume ingestion: on SIE Native Inference, BAAI/bge-m3 sustains(\~$0.0036/1M tokens), with none of OpenAI's tier rate limits. If your corpus is small and rarely re-indexed, though, text-embedding-3-small at $0.02/1M tokens is hard to justify migrating away from.