Skip to content
IT Vizag
← Production Python

▶ Sign up free for the video, slides & prompts

The lesson below is open to all. Enter your email once to unlock every video, slide deck, prompt and code example on this device.

Checking…

Capstone: your production AI service

Lesson 10 of 10 · 3 min read

Tested, logged, containerised and deployed, ready for your resume.

🎬 Video version coming soon — read it now

Time to bring everything together into one project you can show any interviewer: a tested, logged, containerised and deployed AI service.

The brief

Build "Vizag Review Insights": an API that a local business can send customer reviews to, and get back structured insights.

Endpoints

  • POST /v1/classify: one review in, structured classification out (sentiment, topic, summary, needs_reply)
  • POST /v1/classify/batch: up to 20 reviews in; classified in parallel with a concurrency limit
  • GET /v1/stats: counts by sentiment and topic since the server started
  • GET /health

Requirements checklist

Structure (lesson 1)

  • [ ] src layout, pyproject.toml, README with run, test and deploy instructions

Quality (lessons 2 and 5)

  • [ ] pytest tests for the logic and every endpoint, with the AI call faked
  • [ ] Edge cases: empty text, too-long text, 21 reviews in a batch, AI failure
  • [ ] ruff lint and format pass, and type hints throughout (mypy clean is a bonus)

Operations (lessons 3 and 4)

  • [ ] Logging with levels; review text and secrets never logged
  • [ ] Settings from environment variables, with a .env.example committed

AI (lesson 7, Python Meets AI, Async & Performance)

  • [ ] Structured output with Pydantic
  • [ ] Typed AI error handling mapped to proper HTTP status codes
  • [ ] A semaphore limit on parallel AI calls in the batch endpoint
  • [ ] An input length limit, and an access key header required on the AI endpoints

Shipping (lessons 8 and 9)

  • [ ] Dockerfile and .dockerignore; non-root user; secrets passed at run time
  • [ ] Deployed with a public URL and working /docs
  • [ ] A spending limit set at the AI provider

A suggested order

  1. Day 1: structure the project, write the service with a fake classifier, write tests
  2. Day 2: add the FastAPI endpoints with validation and tests
  3. Day 3: plug in the real AI call, error handling and logging
  4. Day 4: the batch endpoint with asyncio, and stats
  5. Day 5: Docker, deploy, README, screenshots

Building with a fake first means most of the project works and is tested before you spend anything on AI calls.

Stretch goals

  • Store results in SQLite so stats survive restarts
  • A tiny HTML page where a shop owner can paste a review and see the result
  • GitHub Actions running ruff, mypy and pytest on every push
  • Telugu and English reviews: test that both work well

Present it

In your README and in interviews, explain:

  • The problem it solves for a real business
  • The architecture: client → FastAPI → service → AI model, with validation, logging and limits
  • Trade-offs you made, such as sync vs async, batch limits and how you control costs
  • What you'd do next with more time

Being able to explain your decisions matters as much as the code.

You did it

Over ten courses you went from print("Hello") to a production AI service: Python foundations, data structures, functions, files, OOP, AI integration, advanced features, performance, testing and deployment. That's the foundation employers look for in Python, backend and AI engineering roles.

Take the quiz to earn your certificate, share your capstone with the IT Vizag community, and help the next learner who's just starting Python Basics.

In one line

Your capstone is a tested, logged, containerised and deployed AI API, which is proof you can build real Python software end to end.

Saved on this device. Sign in to keep progress everywhere.

Share with a friend