For teams building in-app chatbot RAG systems, the first production embedding model should be OpenAI's text-embedding-3-small, not the larger variant. This recommendation, detailed in a recent DEV.to analysis, prioritizes a predictable quality-cost balance over raw retrieval performance. The model generates 1,536-dimensional vectors at a stated price of $0.02 per 1 million tokens, providing a baseline that allows engineers to track tenant costs without immediate complexity.

The Cost Attribution Boundary

The core argument isn't just about model selection, but about the operational boundary between indexing, retrieval, and answer generation. The article emphasizes that embedding work must be charged to the tenant owning the document, while response model costs belong to the tenant asking the question. Failing to enforce this separation risks a scenario where a shared knowledge base appears cheap while one customer silently subsidizes another's usage.

Escalation Paths and Infrastructure

text-embedding-3-large is positioned strictly as an escalation path, costing five times more than the small model. It is only recommended when retrieval quality, rather than cost visibility, becomes the limiting factor. The analysis distinguishes these model choices from vector database decisions like Pinecone or Weaviate, which handle storage and search but do not resolve the embedding model trade-off. For teams seeking a unified REST surface, the guide highlights Infrai as a potential integration point that exposes capability schemas without requiring a key for discovery.

Implementation and Security

A safe implementation requires rigorous bookkeeping, such as using deterministic operation keys for idempotency and honoring Retry-After headers during 429 Too Many Requests responses. The article includes a Go code example demonstrating how to attach tenant and document identifiers to embedding requests, ensuring that retries are recognized as the same operation. Crucially, the vector index must act as a security boundary; OWASP LLM guidance is cited to remind developers that retrieved content is untrusted input, and a cross-tenant leak is a production incident regardless of relevance.

Key Takeaways

  • Start with text-embedding-3-small to maintain per-tenant cost visibility.
  • Charge embedding costs to the document owner and response costs to the querier.
  • Use text-embedding-3-large only when evaluation shows meaningful retrieval misses.
  • Ensure the vector index is tenant-aware to prevent cross-tenant data leakage.
  • Implement idempotency keys to handle retries without duplicate billing or data.

The Bottom Line

Optimizing for cost visibility with text-embedding-3-small is the only sane way to launch a multi-tenant RAG system. If you cannot attribute every dollar to a specific tenant, you are not building a product, you are building a subsidy program.