SOLUTION-LAB-000: Environment Setup¶
Reference solution for LAB-000: Environment Setup.
Overview¶
Complete solution for environment verification and setup.
Exercise 1: OS Check¶
Solution¶
No action needed - informational commands show your system specs.
Exercise 2: Hardware Verification¶
Solution¶
# RAM
# Windows: Get-CimInstance Win32_PhysicalMemory | Select-Object Capacity
# Mac: sysctl hw.memsize
# Linux: free -h
# GPU
nvidia-smi
# Storage
df -h
Exercise 3: Docker Installation¶
Solution (Mac/Linux)¶
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
Solution (Windows)¶
Download and install Docker Desktop from https://www.docker.com/products/docker-desktop
Exercise 4: Python Environment¶
Solution¶
# Create the project environment with uv
# (uv downloads Python 3.13 itself if it is missing)
uv venv --python 3.13
source .venv/bin/activate # macOS/Linux
.\.venv\Scripts\Activate.ps1 # Windows PowerShell
.venv\Scripts\activate.bat # Windows Command Prompt
# Install packages (uv finds the active .venv automatically)
uv pip install torch torchvision torchaudio
uv pip install transformers datasets
uv pip install fastapi uvicorn[standard]
uv pip install ollama
Exercise 5: Ollama Setup¶
Solution¶
# Install
curl -fsSL https://ollama.com/install.sh | sh
# Start server
ollama serve
# Pull model (another terminal)
ollama pull mistral:7b
# Test
ollama run mistral:7b "Hello!"
Exercise 6: End-to-End Test¶
Solution¶
import ollama
# Test connection
response = ollama.generate(model='mistral:7b', prompt='Write a haiku about AI:')
print(response['response'])
# Expected: A haiku about AI
Difficulty: ⭐ Beginner