You're shipping a production-shape RAG service: source docs → indexed vector store → retriever → reranker → grounded LLM answer, exposed behind a FastAPI endpoint. Everything below is required before Phase 1.
Used for embeddings (text-embedding-3-small) + generation (gpt-4o-mini).
Get it ↗Skim the Read mode if "embedding space" or "cosine similarity" feel fuzzy.
For poking the FastAPI service once Phase 5 is up.
Qdrant volume + embedding cache. Negligible for ~500 docs.
| Service | Local / free | Production |
|---|---|---|
| OpenAI embeddings | — | $0.02 / 1M tokens |
| OpenAI generation (gpt-4o-mini) | — | $0.15 / $0.60 per 1M in/out |
| Qdrant | Local Docker · free forever | $25/mo cloud cluster |
| Hosting (FastAPI) | Localhost | $5–20/mo on Fly/Railway |
Indexing 1,000 typical docs (~500k tokens) costs about $0.01 in embeddings. A live demo answering 100 queries/day with gpt-4o-mini lands under $1/month.
Install dependencies and configure your environment for building a production RAG system.
1 qdrant-client>=1.8.0 2 langchain>=0.2.0 3 langchain-openai>=0.1.0 4 langchain-community>=0.2.0 5 openai>=1.25.0 6 python-dotenv>=1.0.0 7 pypdf>=4.0.0
1 services: 2 qdrant: 3 image: qdrant/qdrant:latest 4 ports: 5 - "6333:6333" 6 - "6334:6334" 7 volumes: 8 - qdrant_storage:/qdrant/storage 9 10 volumes: 11 qdrant_storage:
1 OPENAI_API_KEY=sk-... 2 QDRANT_URL=http://localhost:6333 3 COLLECTION_NAME=rag_knowledge_base
$ docker compose up -d ✅ qdrant started on port 6333 $ pip install -r requirements.txt Successfully installed 12 packages
Sign in to share your feedback and join the discussion.