Skip to content

Chapter 4: Infrastructure for AI-First Operations -- Resources

Curated resources for deeper exploration of topics covered in this chapter.

Frameworks from This Chapter

Tools & Platforms

Day 1 Stack (Under $500/month)

  • Vercel -- Serverless deployment platform; auto-injects Supabase credentials and unifies billing.
  • Supabase -- Managed PostgreSQL with built-in auth, pgvector support, and real-time capabilities; 1.7 million developers.
  • Flask -- Python micro web framework; Yirifi's backend choice for all 15 microsites.
  • HTMX -- HTML-first frontend approach; no React or complex frontend frameworks required.

Databases & Storage

  • PostgreSQL -- Primary relational database; with pgvector achieves 471 QPS at 99% recall on 50M vectors.
  • pgvector -- PostgreSQL extension for vector similarity search; 11.4x better than dedicated vector databases on benchmarks.
  • pgvectorscale -- Enhanced pgvector performance from Timescale.
  • Redis -- In-memory caching and session management; add when same data is read 10x+ per write.
  • Pinecone -- Managed vector database; cost-effective at $100-200/month below 80M queries/month threshold.
  • Qdrant -- Open-source vector database for self-hosting at scale.
  • Milvus -- Open-source vector database designed for billion-scale similarity search.
  • Weaviate -- Open-source vector database with built-in ML model integrations.
  • Neo4j -- Graph database for relationship-heavy workloads (knowledge graphs, recommendation systems).
  • MongoDB -- Document store for flexible schema requirements beyond PostgreSQL JSONB.
  • SQLite -- Lightweight database; used by Yirifi for ontology knowledge graph.

Security & Auth

Observability & Cost Tracking

  • Helicone -- LLM observability with built-in caching (20-30% cost reduction); 50-80ms latency trade-off.
  • Langfuse -- Open-source LLM observability platform.
  • LangSmith -- LLM monitoring and evaluation from LangChain.
  • CloudZero -- AI cost tracking; research found only 51% of organizations can evaluate AI ROI.

Further Reading

Research & Data

Community & Learning

Infrastructure Decision Thresholds

Component Buy Threshold Build/Self-Host Threshold
Vector Database < 80M queries/month > 80-100M queries/month
AI Gateway < $10K/month LLM spend > $10K/month LLM spend
Authentication Always buy (security risk) Only delegation logic custom
Observability < 50K events/month > 50K events/month with DevOps capacity
General AI Infra Pre-product-market fit Scale stage (18+ months)