Overview & Setup
What LLMs are, how they work as APIs, and how to set up OpenAI and Anthropic in an Express project.
OpenAI Integration
OpenAI GPT client setup, chat completions, SSE streaming, vision, and embeddings in Express.
Anthropic (Claude) Integration
Anthropic Claude client setup, messages API, SSE streaming, and vision in Express.
Tool Use (Function Calling)
How to give LLMs access to your server-side functions — defining tools, executing them, and handling the loop for both OpenAI and Anthropic.
Conversation History & Sessions
How to manage multi-turn conversations — in-memory sessions, Redis persistence, and context window trimming.
Production Patterns
System prompts, input validation, rate limiting, error handling, and token usage logging for production LLM endpoints.
OpenAI Assistants API & Real Project Patterns
OpenAI Assistants (Threads/Runs), async background jobs, keyword-based KB injection, output sanitization, Zod env validation, and RBAC — all sourced from a production Express codebase.
Real-World Examples
Seven complete production-ready examples — document summarizer, support chatbot, code reviewer, sentiment analysis, RAG, email generator, and NL-to-SQL.