๐ 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
python3instead 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
sudowith 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
๐ Need Help?
๐ Documentation
- โข Python Documentation
- โข PyTorch Get Started
- โข Pip Documentation
๐ฌ Community
- โข Stack Overflow
- โข r/MachineLearning
- โข PyTorch Forums