Beginner⏱ 18 min⚡ 65 XP🧩 5-question quiz

Your AI Toolkit

Set up Python, uv, notebooks, git, and the core AI libraries, and learn to use chat assistants and coding agents as a study partner rather than a crutch.


Over the last five lessons you built a mental model of AI: what it is, where it came from, how machines learn, how generative models work, and where they fail in the real world. Now it is time to get your hands dirty. A carpenter is only as effective as their tools and their skill with them. In AI the toolkit is surprisingly small and almost entirely free: Python, an environment manager, a notebook, version control, a handful of libraries, and, increasingly, AI assistants themselves. This lesson gets you set up and shows you how to use each tool the way professionals do.

The toolkit at a glance

Rendering diagram…

The diagram shows how the pieces fit: an isolated environment holds a Python installation and your libraries, you explore ideas in notebooks, move code that works into scripts, track everything with git, and use AI assistants alongside (the dotted line) to explain and review, not to replace your own thinking.

Python: the language of AI

Python dominates AI not because it is the fastest language, but because it is readable and has an enormous ecosystem. The heavy computation in AI libraries runs in optimized C, C++, Rust, or GPU code underneath; Python is the friendly control panel on top.

To check whether you have Python installed, open a terminal and run:

python3 --version

You want a recent Python 3 release that your libraries support; check each library's installation page if in doubt.

Virtual environments

Different projects need different library versions. A virtual environment gives each project its own isolated set of packages. The modern, fast way is uv, a project and package manager that has become widely used since 2024:

# install uv once (see the uv docs for Windows and other options)
curl -LsSf https://astral.sh/uv/install.sh | sh

uv init ai-course            # create a project with a pyproject.toml
cd ai-course
uv add numpy pandas matplotlib scikit-learn jupyterlab   # installs and records versions
uv run python -c "import numpy; print(numpy.__version__)"
uv run jupyter lab           # run tools inside the project environment

uv add records your dependencies in pyproject.toml and exact versions in a uv.lock file, so anyone can recreate the environment with uv sync.

The classic built-in approach works everywhere too, and it is worth knowing:

python3 -m venv .venv            # create an environment in the folder .venv
source .venv/bin/activate        # activate it (on Windows: .venv\Scripts\activate)
pip install numpy pandas matplotlib scikit-learn jupyterlab
pip freeze > requirements.txt    # record exact versions

Conda is another option, popular when you need non-Python dependencies. Whatever tool you use, the principle is the same: one isolated, recorded environment per project. Module 03 (Python for AI) goes deeper on reproducibility.

Notebooks: Jupyter and Colab

A notebook mixes code, output, charts, and notes in one document, organized into cells you run one at a time. That makes it ideal for exploration: load data, look at it, try an idea, plot the result.

  • JupyterLab runs locally. Start it with uv run jupyter lab or jupyter lab.
  • Google Colab runs in the browser with nothing to install and offers free, limited access to GPUs. It is the easiest place to start. VS Code and other editors also open .ipynb notebooks directly.

Try this in a first cell:

import sys
import numpy as np
import pandas as pd

print("Python", sys.version.split()[0])
print("NumPy", np.__version__, "| pandas", pd.__version__)

df = pd.DataFrame({"model": ["A", "B", "C"], "accuracy": [0.81, 0.86, 0.79]})
df.sort_values("accuracy", ascending=False)

The last expression in a cell is displayed automatically, which is why the sorted table appears without a print.

Tip: Notebooks can be run out of order, which can leave hidden state. Before trusting a result, use "Restart and run all" to confirm the notebook works top to bottom.

For anything you will reuse, such as data loading functions or training code, move it from notebooks into plain .py files. Notebooks are for exploration; scripts and modules are for reliable, testable code.

Git: version control

Git records snapshots of your project over time. You can see what changed, return to a version that worked, and collaborate through platforms like GitHub. The core workflow is a handful of commands:

git init                            # start tracking a folder
git add train.py README.md          # stage changes
git commit -m "Add baseline model"  # save a snapshot with a message
git log --oneline                   # view history

Two AI-specific habits matter. First, do not commit large datasets, model weights, or secrets such as API keys; list them in a .gitignore file and keep keys in environment variables. Second, write meaningful commit messages: "tried learning rate 0.01, val loss improved" is far more useful later than "update".

The core library stack

You will use a small set of libraries constantly. You do not need to master them now; later modules teach each in depth.

LibraryWhat it is for
NumPyFast numerical arrays and linear algebra, the base of nearly everything
pandas (and Polars)Loading, cleaning, and analysing tabular data
matplotlib / seabornPlotting and visualization
scikit-learnClassic ML algorithms, preprocessing, and evaluation
PyTorchBuilding and training neural networks (JAX is a popular alternative in research)
Hugging Face librariesDownloading and using pretrained models and datasets
Provider SDKsCalling hosted models through APIs

A complete, tiny ML workflow touches several of these at once:

from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.tree import DecisionTreeClassifier

X, y = load_iris(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.25, random_state=42)

clf = DecisionTreeClassifier(max_depth=3, random_state=42).fit(X_train, y_train)
print(f"Test accuracy: {clf.score(X_test, y_test):.2f}")

Notice random_state=42: fixing random seeds makes results repeatable, an essential habit you will meet again.

Learning with chat assistants and coding agents

AI assistants are among the best learning tools ever created, if you use them actively. Used passively, they let you skip the struggle that produces real understanding. Research on learning consistently finds that retrieval and effortful practice build durable skill; having answers handed to you feels productive but leaves less behind.

Patterns that work well:

  • Attempt first, then ask. Spend ten honest minutes on an exercise before asking for help. Then ask for a hint, not the solution.
  • Ask for explanations at your level: "Explain overfitting to someone who knows basic algebra, then give a concrete example with numbers."
  • Ask it to quiz you: "Give me five questions on train/test splits, one at a time, and wait for my answer before giving feedback."
  • Get critique, not answers: paste your own code or explanation and ask what is wrong or unclear.
  • Debug with context: include the full error message, the relevant code, and what you expected to happen.
  • Ask for multiple approaches: "Show two ways to do this and explain the trade-offs."

Coding agents, tools that can read your project, edit files, and run commands, are now common in professional software work. While you are learning, use them deliberately: let them explain unfamiliar code, generate test cases for code you wrote, or review your solution. Avoid having them write your exercises for you; you would finish the course without the skills it promises.

And always verify. Run the code. Check claims against official documentation. Be especially careful with library version details, citations, and statistics, which assistants can get wrong confidently.

Note: Never paste secrets, private data, or confidential code into a tool unless you understand and accept its data policy. Give agents only the permissions they need.

Hands-on exercise

  1. Install uv (or use venv), create a project, and add numpy, pandas, scikit-learn, and jupyterlab. If you cannot install anything locally, use Google Colab.
  2. Run the version-check cell and the iris example. Change max_depth to 1 and to 10 and record the test accuracy each time. Then change random_state in the split and see whether the accuracy moves.
  3. Initialize git, add a .gitignore that excludes .venv/, data/, and .env, and make your first commit containing the iris script and your pyproject.toml and uv.lock (or requirements.txt).
  4. Ask a chat assistant to quiz you on the five previous lessons of this module, one question at a time. Answer without looking back, then check its feedback against the lessons. Note one thing it explained well and one claim you had to verify.

Expected outcome: a reproducible project folder under version control that runs a real ML model, and a personal set of rules for learning with AI.

Key takeaways

  • Python is the control panel of AI; isolate each project's packages with uv or venv and record exact versions.
  • Notebooks (JupyterLab, Colab) are for exploration; move reusable code into scripts and check with "Restart and run all".
  • Git tracks your work; never commit secrets or large data.
  • NumPy, pandas, plotting libraries, scikit-learn, PyTorch, and Hugging Face form the core stack.
  • Use assistants and coding agents actively: attempt first, ask for explanation and critique, and verify everything.

That completes AI Foundations. Module 02, Math for AI, gives you the mathematics behind everything you have seen so far: vectors and embeddings, gradients and training, probability and softmax, and the information theory behind the loss that trains every language model.

Further reading

Save your progress and earn XP

Create a free account to take the quiz, track progress and unlock badges.