Environment setup
Welcome! I'm Param, and in this course we are going to build a streaming AI application from scratch with FastAPI. By the end, you will have a running server that streams LLM responses in real-time, with structured prompts, parameter control, and safety guardrails.
We will build a bedtime story generator that takes a character name, age, theme, and length, then streams a personalized story back to the client in real-time. It sounds simple, but it touches every fundamental you need: API calls, prompt engineering, parameter tuning, streaming, and guardrails.
# Copy the example and add your API key
cp .env.example .env
# Then edit .env with your preferred provider:
LLM_PROVIDER=openrouter
OPENROUTER_API_KEY=your_key_here
OPENROUTER_MODEL=google/gemma-3-12b-itThe project supports Fireworks, OpenRouter, Gemini, and OpenAI. You only need one provider. OpenRouter has a free tier to get started.
Validation checklist: Environment setup checklist
Loading practice…