Build AI from Zero • EduArtha

🧠 Build Your Own AI — From Zero to ChatBot

A hands-on journey from counting patterns to fine-tuning your own chatbot. Build every piece yourself!

⏱ 5–6 hours  |  7 Chapters  |  35+ Exercises  |  25+ Code Files  |  Indian Context

🚀 How to Run the Project

Read the lesson.md in each level first, then run the scripts in order

⚙️ Step 0 — Install (one time)

cd build-ai-from-zero
pip install -r requirements.txt

🟢 Level 1 — Prediction (Pure Python)

cd level_1_prediction
python step1_bigram.py        # Count character patterns
python step2_generate.py      # Generate text from patterns

🟡 Level 2 — Neural Network (NumPy)

cd level_2_neural_network
python step1_neuron.py        # Build a single neuron
python step2_network.py       # Build a multi-layer network
python step3_train.py         # Train with backprop from scratch
python step4_visualize.py     # Plot loss curves

🟠 Level 3 — Transformer (PyTorch)

cd level_3_transformer
python step1_embedding.py          # Token + positional embeddings
python step2_attention.py          # Self-attention mechanism
python step3_transformer_block.py  # Full transformer block
python step4_put_it_together.py    # Complete Mini-Transformer

🔴 Level 4 — Train Your Mini-GPT ⭐

cd level_4_mini_gpt
python train.py               # Train on Indian stories (~5-10 min)
python generate.py            # Chat with YOUR model!

🟣 Level 5 — Fine-Tune a Real Model

cd level_5_real_finetune
python prepare_data.py        # Prepare education Q&A data
python finetune.py            # Fine-tune DistilGPT-2 with LoRA
python chat.py                # Chat with your fine-tuned bot!

📖 Tip: Each level has a lesson.md — read it first to understand the concepts before running the code. Every script prints colorful output explaining what's happening! 🎨

Part I

Foundations

Understanding AI and why it matters