Inspiration
We have LeetCode for DSA, and plenty of platforms for software engineering. But where is the practice ground for AI engineers? Most beginners learn AI from ten hour tutorials or framework shortcuts, and never understand what is underneath. Resources are scattered and huge, so it is hard to know where to start or whether you are on track.
AI Lab is the project I wish existed when I started learning AI: a guided pathway where you build the real thing yourself, with a tutor beside you.
What it does
AI Lab is LeetCode for AI: 6 pathways and 52 lessons, from beginner to mid-level.
- Foundations: Python, Git, NumPy, Pandas, APIs
- Math and ML: vectors, probability, gradients, regression
- Neural Networks: perceptron to backpropagation, PyTorch, CNNs
- Language Models: tokens, embeddings, attention, RAG
- AI Agents: tool calling, the agent loop, MCP, guardrails
- Build and Ship: vector search, a RAG app, security, deployment
Every lesson follows the same loop: Read, Try it (starter code with TODOs, plus a solution), then a Quiz. Passing at 70% completes the lesson and updates your progress. An AI tutor powered by Groq's free API sits beside every lesson, knows which lesson you are on, and gives hints instead of just answers.
What I learned
Building lessons forced me to understand the ideas well enough to explain them simply. I also learned how much work sits between "it works on my machine" and a safe product: validation, rate limits, and free-tier API behavior.
How I built it
- Frontend: React and Vite, with a responsive cream and plum theme
- Backend: Node.js, Express, MongoDB (Mongoose)
- AI: Groq's OpenAI-compatible chat API, called only from the server
- Content: lessons are Markdown files with a small custom format. A seed script validates every file and loads it into MongoDB, so adding a lesson means adding a file
Security on the backend: bcrypt password hashing, account lockout, short-lived tokens in httpOnly cookies with rotating refresh tokens, CSRF protection, strict input validation, request size limits, NoSQL injection protection, rate limits, and a daily per-user tutor quota. Quiz answers never leave the server until you submit, and tutor context is loaded from the database, never from the client.
Challenges
- Retired model: my first Groq calls failed with a 404
model_not_found. The model I used had been retired. I made the model ID a setting and wrote the tutor to report the problem clearly instead of failing silently. - Free-tier limits: Groq answers 429 when you go over its limits. The server reads the
retry-afterheader, retries when the wait is short, and otherwise tells the student how long to wait. - Content at scale: writing 52 lessons took the most time. I ran every code solution before including it, and my validator caught quiz questions with no correct answer.
- A quiz bias I almost shipped: about 70% of my correct answers were the second option. The seed script now shuffles the options.
What's next
- Auto-graded tests and an in-browser code runner (today, students run exercises on their own computer)
- More projects per pathway
- Deeper lessons and streaks
Credits
Lesson topics are adapted from the open-source AI Engineering from Scratch course (MIT license). All lesson text, code exercises and quizzes in AI Lab were written for this project.