Editorial review: Source-derived learning material, October 2026. Employment milestones are targets, not guarantees. Hiring figures, certification details, vendor capabilities, prices and cloud costs are source claims requiring re-verification before use. Code snippets may need adaptation to current SDKs; never run cloud commands in production.

Local lab environment

Everything runs on a laptop first. AWS is used for deployment, cloud evals and credentials, with Budgets and teardown discipline. About 80% of iterations should be local.

Hardware

  • Minimum: 16 GB RAM, 4+ cores, 60 GB free disk.
  • Recommended: 32 GB RAM, Apple Silicon or NVIDIA GPU with 8+ GB VRAM.
  • qwen3:8b needs ~5 GB at Q4. On 16 GB machines use Phoenix (one container) for tracing; full self-hosted Langfuse needs ~16 GB on its own.

Decisions baked in

  • uv for Python; everything pinned in uv.lock (agent and MCP SDKs changed a lot in 2026).
  • moto (MIT, no account) for AWS unit tests. LocalStack now requires an auth token and its free plan is non-commercial only: use it only for personal learning.
  • Native Ollama on macOS (Docker on Mac cannot use the Apple GPU).

Step 1 · Base toolchain

macOS
xcode-select --install
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install uv git gh jq duckdb awscli node
brew install --cask docker          # or OrbStack / Colima
brew install ollama && (ollama serve &)
npm install -g aws-cdk
uv --version && docker --version && ollama --version && aws --version && cdk --version
PowerShell (admin)
wsl --install -d Ubuntu-24.04
# Install Docker Desktop -> Settings -> Resources -> WSL Integration -> enable Ubuntu
# Install Ollama for Windows (native). From WSL reach it at http://localhost:11434
# (enable mirrored networking in .wslconfig) or use the Windows host IP.
Inside Ubuntu (WSL)
sudo apt update && sudo apt install -y git jq unzip build-essential curl
curl -LsSf https://astral.sh/uv/install.sh | sh
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o awscliv2.zip && unzip awscliv2.zip && sudo ./aws/install
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash - && sudo apt install -y nodejs && sudo npm i -g aws-cdk
(type -p gh >/dev/null) || sudo apt install -y gh
Linux
curl -fsSL https://get.docker.com | sh && sudo usermod -aG docker $USER   # log out/in
curl -LsSf https://astral.sh/uv/install.sh | sh
curl -fsSL https://ollama.com/install.sh | sh
# AWS CLI v2 + Node 22 + CDK as in the WSL block

Step 2 · Models

Ollama
ollama pull qwen3:8b              # default tool-calling model on 16 GB machines
ollama pull nomic-embed-text      # local embeddings (768 dims)
# 32 GB+ RAM or 24 GB VRAM: ollama pull qwen3:30b-a3b
ollama show qwen3:8b              # confirm "tools" under Capabilities

Third-party 2026 guides rank Qwen3 8B as the default local tool-calling model; treat their reliability figures as anecdotal and measure on your golden set.

Step 3 · Project dependencies

uv
uv init analyst-copilot && cd analyst-copilot && uv python pin 3.12
uv add duckdb polars pandas pyarrow sqlglot fastapi uvicorn pydantic streamlit \
       "psycopg[binary]" pgvector boto3 ollama "strands-agents[ollama]" strands-agents-tools \
       "mcp[cli]" arize-phoenix-otel pyyaml httpx
uv add --dev pytest ruff moto deepeval ragas ipykernel jupyterlab

Step 4 · docker-compose.yml

docker-compose.yml
services:
  postgres:
    image: pgvector/pgvector:pg17
    environment: {POSTGRES_USER: fde, POSTGRES_PASSWORD: fde_local_only, POSTGRES_DB: analytics}
    ports: ["5432:5432"]
    volumes: [pgdata:/var/lib/postgresql/data, ./sql/init:/docker-entrypoint-initdb.d:ro]
    healthcheck: {test: ["CMD-SHELL", "pg_isready -U fde"], interval: 5s, retries: 10}
  minio:
    image: minio/minio
    command: server /data --console-address ":9001"
    environment: {MINIO_ROOT_USER: minio, MINIO_ROOT_PASSWORD: minio_local_only}
    ports: ["9000:9000", "9001:9001"]
    volumes: [miniodata:/data]
  phoenix:
    image: arizephoenix/phoenix:latest
    ports: ["6006:6006", "4317:4317"]
  jupyter:
    image: quay.io/jupyter/scipy-notebook
    ports: ["8888:8888"]
    volumes: [./notebooks:/home/jovyan/work, ./data:/home/jovyan/data]
  sandbox:                         # Week 9 code-interpreter target
    image: quay.io/jupyter/scipy-notebook
    network_mode: none
    mem_limit: 2g
    cpus: 1.0
    volumes: [./sandbox:/home/jovyan/work, ./data/extracts:/home/jovyan/data:ro]
    command: ["sleep", "infinity"]
    profiles: ["sandbox"]
  localstack:                      # optional; needs LOCALSTACK_AUTH_TOKEN; Hobby plan = non-commercial
    image: localstack/localstack
    environment: {LOCALSTACK_AUTH_TOKEN: "${LOCALSTACK_AUTH_TOKEN}"}
    ports: ["4566:4566"]
    profiles: ["aws-emu"]
volumes: {pgdata: {}, miniodata: {}}
Run
docker compose up -d && docker compose ps
# Postgres :5432 · MinIO console http://localhost:9001 · Phoenix http://localhost:6006 · Jupyter :8888
docker compose logs jupyter | grep token     # Jupyter login URL
docker compose down -v                        # wipe volumes (re-runs init SQL)

Step 5 · Datasets

DatasetUseHow
TPC-H (DuckDB extension)Weeks 1–8: clean schema, known answersCALL dbgen(sf=1)
NYC TLC Yellow Taxi (Parquet)Weeks 9–10: volume, dirty values, time seriesDownload monthly files from the TLC Trip Record Data page
Chinook / NorthwindQuick demos, small readable schemasSQL scripts from their public repos
BIRD dev setEval-method practice onlyRemember the documented annotation errors
Synthetic (Faker)Projects 3–4: procurement, suppliers with seeded anomaliesGenerator script + ground-truth file

Step 6 · Read-only role and row-level security

sql/init/10_roles.sql
CREATE SCHEMA IF NOT EXISTS tpch;
CREATE ROLE agent_ro LOGIN PASSWORD 'agent_ro_local';
GRANT CONNECT ON DATABASE analytics TO agent_ro;
GRANT USAGE ON SCHEMA tpch TO agent_ro;
ALTER DEFAULT PRIVILEGES FOR ROLE fde IN SCHEMA tpch GRANT SELECT ON TABLES TO agent_ro;
ALTER ROLE agent_ro SET default_transaction_read_only = on;
ALTER ROLE agent_ro SET statement_timeout = '15s';
sql/init/20_rls.sql (apply after loading tables)
-- One DB role per region/user; never let the model SET roles or session variables.
CREATE ROLE agent_emea LOGIN PASSWORD 'x' IN ROLE agent_ro;
ALTER ROLE agent_emea SET default_transaction_read_only = on;
ALTER TABLE tpch.orders ENABLE ROW LEVEL SECURITY;
CREATE POLICY emea_only ON tpch.orders FOR SELECT TO agent_emea
  USING (o_custkey IN (
    SELECT c.c_custkey FROM tpch.customer c
    JOIN tpch.nation n ON c.c_nationkey = n.n_nationkey
    JOIN tpch.region r ON n.n_regionkey = r.r_regionkey
    WHERE r.r_name = 'EUROPE'));
-- agent_ro (no policy) now sees no orders rows: add a permissive policy for it if needed.

Note: init scripts run before you load TPC-H, so default privileges cover tables created later by fde. If you load tables first, run GRANT SELECT ON ALL TABLES IN SCHEMA tpch TO agent_ro.

Step 7 · SQL guard (defense layer 1 of 4)

agent/guard.py
import sqlglot
from sqlglot import exp

ALLOWED = {"customer", "orders", "lineitem", "nation", "region", "part", "partsupp", "supplier"}
FORBIDDEN = (exp.Insert, exp.Update, exp.Delete, exp.Drop, exp.Create, exp.Alter,
             exp.Command, exp.Merge)

def guard(sql: str, dialect: str = "duckdb", max_rows: int = 1000) -> str:
    stmts = [s for s in sqlglot.parse(sql, read=dialect) if s is not None]
    if len(stmts) != 1:
        raise ValueError("Exactly one statement allowed")
    root = stmts[0]
    if not isinstance(root, (exp.Select, exp.Union)):
        raise ValueError("Only SELECT queries allowed")
    if any(True for _ in root.find_all(*FORBIDDEN)):
        raise ValueError("Write/DDL detected")
    ctes = {c.alias_or_name.lower() for c in root.find_all(exp.CTE)}
    tables = {t.name.lower() for t in root.find_all(exp.Table)} - ctes
    if any(not t for t in tables) or not tables <= ALLOWED:
        raise ValueError(f"Table or table function not allowed: {sorted(tables - ALLOWED)}")
    if isinstance(root, exp.Select) and not root.args.get("limit"):
        root = root.limit(max_rows)
    return root.sql(dialect=dialect)

Layers 2–4: DuckDB read_only=True + SET enable_external_access=false; Postgres read-only role + statement_timeout; RLS per user. Cloud adds Lake Formation, Athena scan limits and AgentCore Policy (Cedar). Test table functions like read_csv(...) explicitly: confirm in your tests that the guard rejects them.

Step 8 · Local → AWS mapping and cost controls

LocalAWS counterpartCost control
DuckDB / ParquetS3 + Glue Data Catalog + AthenaPartition data; workgroup per-query scan limit
MinIOS3Lifecycle rules; tag project=fde-lab
Postgres + pgvectorAurora PostgreSQL Serverless v2 + pgvector, or Bedrock Knowledge BasesStop/delete after each lab
Ollama (qwen3:8b)Amazon Bedrock modelsSmall models for dev; log tokens per request
sqlglot guard + RO role + RLSIAM + Lake Formation + AgentCore Policy (Cedar)Policy billed per authorization request
FastAPI containerAgentCore Runtime or ECS Fargate (CDK)cdk destroy each session
FastMCP serverAgentCore Gateway (MCP targets)—
Sandboxed JupyterAgentCore Code InterpreterSession timeouts
PhoenixAgentCore Observability → CloudWatchLog retention 7–14 days
evals/run.pyAgentCore Evaluations (on-demand / online / batch)Sample online traffic
— (Week 7 only)Bedrock KB structured store on Redshift ServerlessCreate, test, delete same day
motoDedicated sandbox AWS accountBudgets at 50/80/100% + Cost Anomaly Detection
Makefile: one-command teardown
nuke:
	cd infra && cdk destroy --all --force
	aws s3 rm s3://$$BUCKET --recursive || true
spend:
	aws ce get-cost-and-usage --time-period Start=$$(date -u +%Y-%m-01),End=$$(date -u +%Y-%m-%d) \
	  --granularity MONTHLY --metrics UnblendedCost --filter '{"Tags":{"Key":"project","Values":["fde-lab"]}}' 

Cloud spend figures in this program are planning estimates. Check current Bedrock, AgentCore, Athena, Aurora and Redshift pricing pages before each cloud week.