FastAPI + Anthropic: Building Reliable Multi-Step AI Workflows with Claude
Patterns for building multi-step, tool-calling workflows on Claude that don't silently fail — retries, tool-call validation, and cost tracking across chained calls.
Short, practical articles on FastAPI, LLMs, and RAG. Written for developers who build and ship AI backends, not just read about them.
Patterns for building multi-step, tool-calling workflows on Claude that don't silently fail — retries, tool-call validation, and cost tracking across chained calls.
When pgvector stops being the right choice, what migrating to Qdrant actually involves, and how to keep both running during the transition.
When to offload AI work to Celery, how to design idempotent tasks for LLM calls, and patterns for reporting progress back to the client.
Redis does three distinct jobs in a RAG backend — rate limiting, embedding cache, and session store. Here's how to implement each without them colliding.
Beyond the basic OpenAI API call — session management, streaming, rate limiting, and cost control for a chatbot backend that survives real traffic.
How to wire Stripe's metered billing to token consumption in a FastAPI AI backend — metering strategy, webhook handling, and per-key usage tracking.
How to implement real-time streaming chat responses using SSE in FastAPI, with token counting and proper error handling.
A practical guide to the routers, services, and repository pattern that makes FastAPI codebases easy to maintain at scale.
A complete walkthrough of building a retrieval-augmented generation pipeline: document ingestion, embedding, vector search, and LLM context injection — all in async FastAPI.
How to implement production-grade JWT authentication and API key issuance in FastAPI — with refresh tokens, per-key rate limiting, and secure storage.
How to implement token-based usage metering with Stripe's metered billing in a FastAPI backend — from per-request tracking to webhook handling.
Step-by-step production deployment of a FastAPI app with Postgres, Redis, and Celery workers on Railway and Render — including migration automation and health checks.
How to offload long-running LLM tasks to Celery workers in FastAPI — job queuing, status polling, result storage, and monitoring with Flower.
The right way to use SQLAlchemy 2.0 async sessions in FastAPI — dependency injection, transaction management, eager loading, and common pitfalls.