Setup Guide - Zero to AIΒΆ
Quick Start with UV (Recommended)ΒΆ
UV is an extremely fast Python package installer and resolver written in Rust. Itβs 10-100x faster than pip!
1. Run the installation scriptΒΆ
./install_dependencies.sh
This will:
Install UV if not already installed
Create a virtual environment at
.venv/Install all dependencies using UV
Activate the environment
2. Activate the environmentΒΆ
source .venv/bin/activate
3. Start learning!ΒΆ
# Start Jupyter
jupyter notebook
# Or open a specific notebook
jupyter notebook 04-token/tiktoken_example.ipynb
Manual Installation with UVΒΆ
If you prefer manual control:
Install UVΒΆ
curl -LsSf https://astral.sh/uv/install.sh | sh
Create virtual environmentΒΆ
uv venv .venv
source .venv/bin/activate # On macOS/Linux
# .venv\Scripts\activate # On Windows
Install dependenciesΒΆ
# Core dependencies
uv pip install -r requirements.txt
# Or install specific packages from the curriculum stack
uv pip install torch transformers tiktoken sentence-transformers jupyter
Alternative: Traditional pip/venvΒΆ
If you prefer not to use UV:
# Create virtual environment
python -m venv .venv
source .venv/bin/activate
# Install dependencies
pip install -r requirements.txt
Verify InstallationΒΆ
# Check Python version
python --version # Should be 3.11+
# Test imports
python -c "import torch; print(f'PyTorch {torch.__version__}')"
python -c "import transformers; print(f'Transformers {transformers.__version__}')"
python -c "import tiktoken; print('tiktoken β
')"
python -c "import sentence_transformers; print('sentence-transformers β
')"
# Start Jupyter
jupyter notebook
Dependencies OverviewΒΆ
Core ML/DLΒΆ
PyTorch - Deep learning framework
Transformers - HuggingFace library (BERT, GPT, etc.)
Torchvision - Vision models and datasets
TokenizationΒΆ
tiktoken - OpenAIβs tokenizer
tokenizers - HuggingFace tokenizers library
sentencepiece - Googleβs tokenizer
Embeddings & Vector DBsΒΆ
sentence-transformers - Sentence embeddings
chromadb - Vector database
qdrant-client - Qdrant vector DB
weaviate-client - Weaviate vector DB
pymilvus - Milvus vector DB
pgvector - PostgreSQL vector extension
Data ScienceΒΆ
numpy, pandas, scikit-learn, scipy - Data science essentials
matplotlib, seaborn, plotly - Visualization
DevelopmentΒΆ
jupyter - Interactive notebooks
pytest, black, flake8 - Testing and formatting (dev extras)
Learning PathΒΆ
Once setup is complete, follow this path:
Start with the first phase for your chosen track
Use
00_START_HERE.ipynbinside each module when available
Which Requirements File to Use?ΒΆ
File |
Use When |
|---|---|
|
Local development (pip) |
|
Local development (Conda/Mamba) |
|
Google Colab β skips pre-installed packages |
|
Kaggle notebooks β skips pre-installed packages, requires Internet toggle enabled |
|
Replit β auto-installed on run |
|
|
TroubleshootingΒΆ
UV installation failsΒΆ
# Try with pip instead
pip install uv
PyTorch GPU supportΒΆ
For CUDA support, install PyTorch separately:
# See https://pytorch.org for your specific CUDA version
uv pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118
PostgreSQL dependenciesΒΆ
For pgvector to work, ensure PostgreSQL development headers are installed:
# macOS
brew install postgresql
# Ubuntu/Debian
sudo apt-get install postgresql-server-dev-all
# Then reinstall psycopg2-binary
uv pip install --force-reinstall psycopg2-binary
Jupyter kernel not foundΒΆ
python -m ipykernel install --user --name=aiml
Environment VariablesΒΆ
Some notebooks require API keys or database connections. Create a .env file:
# OpenAI (for embeddings notebooks)
OPENAI_API_KEY=your_key_here
# Aurora PostgreSQL (for 6-vector-databases/06_aurora_pgvector_guide.ipynb)
AURORA_HOST=your-cluster.region.rds.amazonaws.com
AURORA_PORT=5432
AURORA_DATABASE=vectordb
AURORA_USER=postgres
AURORA_PASSWORD=your_password
# AWS (optional, for AWS services)
AWS_ACCESS_KEY_ID=your_key
AWS_SECRET_ACCESS_KEY=your_secret
AWS_DEFAULT_REGION=us-east-1
Why UV?ΒΆ
UV is a next-generation Python package manager:
β
10-100x faster than pip
β
Better dependency resolution (like Poetry/PDM)
β
Drop-in replacement for pip commands
β
Written in Rust for maximum performance
β
Creates reproducible environments
Example speed comparison:
pip: ~45 seconds
UV: ~2 seconds
Need Help?ΒΆ
Check notebook
00_START_HERE.ipynbfiles in each sectionReview
README.mdin each folder
Happy learning! π