📚 Prerequisites Guide
Everything you need to know before building your first LLM
🚀 Quick Start Checklist
✅ Required Knowledge
- • Basic Python programming
- • High school mathematics
- • Basic command line usage
⚡ Estimated Time
- • Setup: 10-15 minutes
- • Tutorial: 2-3 hours
- • Training: 20-30 minutes
💻 System Requirements
🖥️ Minimum
- • 8GB RAM
- • 2GB free disk space
- • Python 3.10+
- • Internet connection
⚡ Recommended
- • 16GB+ RAM
- • GPU (NVIDIA/Apple Silicon)
- • SSD storage
- • Stable internet
🚀 Optimal
- • 32GB+ RAM
- • Modern GPU (RTX 5080+/H200/AMD RX 8900-AI/Apple M4 Pro+)
- • Fast NVMe SSD
- • Good cooling
🔧 Platform Setup
Step 1: Install Python
# Using Homebrew (recommended) brew install python # Verify installation python3 --version
Alternative: Download from python.org
Step 2: Install Git
# Install Git brew install git # Configure Git (optional) git config --global user.name "Your Name" git config --global user.email "your.email@example.com"
Step 3: Setup Project Environment
# Create project directory mkdir llm-tutorial && cd llm-tutorial # Create virtual environment python3 -m venv venv # Activate virtual environment source venv/bin/activate # Download requirements curl -O https://raw.githubusercontent.com/geekyabhijit/Build_LLM/main/requirements.txt # Install dependencies pip install -r requirements.txt
🍎 Apple Silicon Optimization
Your Mac will automatically use MPS (Metal Performance Shaders) for GPU acceleration. No additional setup needed!
👨💻 Development Environment
🎯 Recommended: VS Code
- • Download from code.visualstudio.com
- • Install Python extension
- • Install Jupyter extension
- • Built-in terminal
💡 Pro tip: VS Code will automatically detect your virtual environment
🔄 Alternatives
- • PyCharm: Full IDE experience
- • Jupyter Lab: Notebook-focused
- • Vim/Neovim: Terminal-based
- • Sublime Text: Lightweight
🔧 Environment Managers (2025)
While Conda is still fine, many developers have moved to lighter alternatives for reproducible environments:
Micromamba
# Install micromamba curl -Ls https://micro.mamba.pm/api/micromamba/$(uname -s)/latest | tar -xvj bin/micromamba # Create environment micromamba create -n llm-tutorial python=3.12 # Activate environment micromamba activate llm-tutorial
Pixi
# Install pixi curl -fsSL https://pixi.sh/install.sh | bash # Create project pixi init llm-tutorial pixi add torch torchvision torchaudio # Run commands in environment pixi run python script.py
Both are faster and lighter than Conda, with better dependency resolution.
🧠 Knowledge Prerequisites
✅ Essential (You Must Know)
Python Basics
- • Variables and data types
- • Functions and classes
- • Lists and dictionaries
- • For loops and if statements
Math Concepts
- • Basic algebra
- • Matrix multiplication (concept)
- • What is a derivative (intuition)
- • Probability basics
⚡ Helpful (Nice to Have)
Programming
- • NumPy basics
- • Basic command line
- • Git basics
- • Virtual environments
AI/ML
- • What neural networks do
- • Gradient descent (concept)
- • Training vs inference
- • Overfitting concept
See our Cutting-Edge LLM Learning Resources for crash courses on GenAI & LLMs
🚀 Advanced (We'll Teach You)
Don't worry if you don't know these - the tutorial covers everything:
- • Transformer architecture
- • Self-attention mechanism
- • Tokenization
- • Embedding layers
- • PyTorch fundamentals
- • Backpropagation
- • Model training loops
- • GPU acceleration
📖 Quick Learning Resources
Need to brush up on something?
🐍 Python Programming (30-60 mins)
📚 Interactive Tutorials:
- LearnPython.org Interactive Tutorial - Learn by doing
- Codecademy Python Course - Structured lessons
- FreeCodeCamp Python - Project-based
📖 References:
- Official Python Tutorial - Comprehensive guide
- Real Python - Practical tutorials
🧮 Mathematics (45-90 mins)
🎥 Visual Learning:
- 3Blue1Brown: Essence of Linear Algebra - Visual intuition
- 3Blue1Brown: Essence of Calculus - Beautiful explanations
- Linear Algebra Playlist - Complete series
📚 Interactive Practice:
- Khan Academy: Linear Algebra - Practice problems
- Khan Academy: Basic Calculus - Step-by-step
🤖 Deep Learning Fundamentals (1-2 hours)
🎯 Essential Watching:
- 3Blue1Brown: Neural Networks - Best introduction
- But what is a neural network? - 19 min masterpiece
- Gradient descent, how neural networks learn - Core concept
🚀 Practical Courses:
- Fast.ai: Practical Deep Learning - Top-down approach
- Andrew Ng's ML Course - Bottom-up approach
🔥 PyTorch Essentials (30-45 mins)
📖 Official Resources:
- PyTorch Basics Tutorial - Official quickstart
- Tensors Tutorial - Core data structure
- Autograd Tutorial - Automatic differentiation
🎥 Video Tutorials:
- PyTorch in 100 Seconds - Quick overview
- PyTorch Tutorials Playlist - Comprehensive series
🔧 Development Tools (20-30 mins)
📝 Editor Setup:
- VS Code Python Setup - Recommended IDE
- Python IDE Comparison - Choose your editor
⚙️ Environment Management:
- Python Virtual Environments - Essential skill
- Git Basics - Version control
🌟 Cutting-Edge LLM Learning Resources (2025)
Stay current with the latest in LLM research and applications
🚀 Crash-course on GenAI & LLMs
📚 Google Cloud Micro-courses:
- Introduction to Generative AI / LLMs - 8 parts, 4 hrs total
Fast, hands-on, and updated this month.
🎓 Full Semester Depth
📚 University Courses:
- CMU 11-667 Large Language Models - Spring 2025, Slides + assignments on scaling laws, RLHF, retrieval, evaluation
- Stanford CS324: LLMs - Winter 2025, Focus on efficient training, serving, compression
- Toronto CSC 2541 (W'25) - Large Models, Practical walk-through of modern training stacks via Llama 3
🔧 Prompt Engineering & LLMOps
📚 Updated Courses:
- DeepLearning.AI / Coursera "LLMOps" - Updated 2025
- "ChatGPT Prompt Engineering for Devs" - Updated 2025
Keeps your deployment & prompting skills current.
⚡ Performance Enhancements (2025)
Optional enhancements for faster training and inference
🔥 Flash-Attention 3
For faster training on Ampere+ GPUs:
pip install flash-attn --no-build-isolation
Add to your requirements.txt for faster attention mechanisms.
🚀 vLLM
For blazing-fast inference:
pip install vllm
Now officially under the PyTorch Foundation for optimized inference.
🐳 Containerization
Pre-baked Docker image with all optimizations:
# Use the llm-stack Docker image # PyTorch 2.7 + CUDA 12.6 + Flash-Attn 3 pre-baked docker run --gpus all -it llm-stack/pytorch:2.7-cuda12.6-flash3
Simplified setup with all performance enhancements pre-installed.
✅ Final Readiness Check
Ready to start? Check these boxes:
🔧 Common Setup Issues
❌ "python: command not found"
Try these solutions:
- Use
python3
instead ofpython
- Check if Python is in your PATH environment variable
- Reinstall Python and check "Add to PATH" option
- Restart your terminal/command prompt
❌ "pip install" fails with permissions error
Solutions:
- Make sure your virtual environment is activated
- On Linux/Mac: Don't use
sudo
with pip - Try:
pip install --user package_name
- Update pip:
python -m pip install --upgrade pip
❌ PyTorch installation issues
Platform-specific solutions:
- Windows: Install Microsoft Visual C++ Build Tools
- Mac M1/M2: Use the conda-forge channel
- Linux: Check CUDA version compatibility
- All: Try CPU-only version first:
pip install torch --index-url https://download.pytorch.org/whl/cpu
❌ Virtual environment not working
Common fixes:
- Make sure you're in the right directory
- Check activation command for your platform
- Verify with:
which python
(should show venv path) - Try recreating:
rm -rf venv && python -m venv venv