felixFELIX
forlearnai
PH00โ€บDev Environment
SRC
PHASE
00 ยท Setup & Tooling
TYPE
Build
LANG
Python, TypeScript, Rust

Dev Environment

Your tools shape your thinking. Set them up once, set them up right.

Type: Build Languages: Python, Node.js, Rust Prerequisites: None Time: ~45 minutes

Learning Objectives

  • Set up Python 3.11+, Node.js 20+, and Rust toolchains from scratch
  • Configure virtual environments and package managers for reproducible builds
  • Verify GPU access with CUDA/MPS and run a test tensor operation
  • Understand the four-layer stack: system, packages, runtimes, AI libraries

The Problem

You're about to learn AI engineering across 200+ lessons using Python, TypeScript, Rust, and Julia. If your environment is broken, every single lesson becomes a fight against tooling instead of learning.

Most people skip environment setup. Then they spend hours debugging import errors, version conflicts, and missing CUDA drivers. We're going to do this once, properly.

The Concept

An AI engineering environment has four layers:

We install bottom-up. Each layer depends on the one below it.

Build It

Step 1: System Foundation

Check your system and install the basics.

# macOS
xcode-select --install
brew install git curl wget

# Ubuntu/Debian
sudo apt update && sudo apt install -y build-essential git curl wget

# Windows (use WSL2)
wsl --install -d Ubuntu-24.04

Step 2: Python with uv

We use uv โ€” it's 10-100x faster than pip and handles virtual environments automatically.

curl -LsSf https://astral.sh/uv/install.sh | sh

uv python install 3.12

uv venv
source .venv/bin/activate  # or .venv\Scripts\activate on Windows

uv pip install numpy matplotlib jupyter

Verify:

import sys
print(f"Python {sys.version}")

import numpy as np
print(f"NumPy {np.__version__}")
a = np.array([1, 2, 3])
print(f"Vector: {a}, dot product with itself: {np.dot(a, a)}")

Step 3: Node.js with pnpm

For TypeScript lessons (agents, MCP servers, web apps).

curl -fsSL https://fnm.vercel.app/install | bash
fnm install 22
fnm use 22

npm install -g pnpm

node -e "console.log('Node', process.version)"

Step 4: Rust

For performance-critical lessons (inference, systems).

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

rustc --version
cargo --version

Step 5: Julia (Optional)

For math-heavy lessons where Julia shines.

curl -fsSL https://install.julialang.org | sh

julia -e 'println("Julia ", VERSION)'

Step 6: GPU Setup (If You Have One)

# NVIDIA
nvidia-smi

# Install PyTorch with CUDA
uv pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124
import torch
print(f"CUDA available: {torch.cuda.is_available()}")
if torch.cuda.is_available():
    print(f"GPU: {torch.cuda.get_device_name(0)}")

No GPU? No problem. Most lessons work on CPU. For training-heavy lessons, use Google Colab or cloud GPUs.

Step 7: Verify Everything

Run the verification script:

python phases/00-setup-and-tooling/01-dev-environment/code/verify.py

Use It

Your environment is now ready for every lesson in this course. Here's what you'll use where:

LanguageUsed InPackage Manager
PythonPhases 1-12 (ML, DL, NLP, Vision, Audio, LLMs)uv
TypeScriptPhases 13-17 (Tools, Agents, Swarms, Infra)pnpm
RustPhases 12, 15-17 (Performance-critical systems)cargo
JuliaPhase 1 (Math foundations)Pkg

Ship It

This lesson produces a verification script that anyone can run to check their setup.

See outputs/prompt-env-check.md for a prompt that helps AI assistants diagnose environment issues.

Exercises

  1. Run the verification script and fix any failures
  2. Create a Python virtual environment for this course and install PyTorch
  3. Write a "hello world" in all four languages and run each one
๐Ÿ“ฆ
WHAT THIS LESSON SHIPS
Prompts, skills, and artifacts you can use right now
PROMPTprompt-env-check.md

Diagnose and fix AI engineering environment setup issues

VIEW
๐Ÿ’ป
RUN THE CODE
Executable files from this lesson
๐Ÿverify.py2.1 KB
python phases/00-setup-and-tooling/01-dev-environment/code/verify.py
๐Ÿง 
KNOWLEDGE CHECK
5 questions ยท test your understanding
PRE

Why do AI projects need a separate virtual environment?

PRE

What does CUDA provide for AI workloads?

POST

In the four-layer environment stack, which layer must be installed first?

POST

What is the purpose of uv in a Python AI project?

POST

How do you verify that PyTorch can access your GPU?

๐Ÿ—บ
LEARNING PATH
Phase 00: Setup & Tooling
0/12 LESSONS COMPLETE IN THIS PHASE
Finished reading? Mark this lesson complete to track your progress.