Start here: the foundation before AI
Lesson 1 of 1
1Start here: the foundation before AI
The big pictureEvery AI model is a program running on a computer, reading data from files or the internet, which you write and run from the terminal and save in Git. These four tools come before any algorithm.
What the picture shows: The five layers of the foundation. Each has a full track in stage 0 of the software engineering path.
Map of this part
The concepts in order, click any one to jump to it:
Two ways into the same idea
Before fine cooking you need to know where the kitchen is, how to light the stove and how to read a recipe. AI is the fine cooking; computers, programming and the terminal are the kitchen. This lesson is a quick tour of the kitchen, and the foundation tracks are the full training.
For the AI path you need specifically: memory versus disk (why huge data does not fit in memory), CPU versus GPU (why training runs on GPUs), HTTP and JSON (since most models are called over an API), variables, conditions, loops and functions, moving around the terminal, installing packages and virtual environments, and Git for code (not for huge data or model weights). If these are familiar, the stage test moves you straight on.
Before You Start
🙂Nothing
This is the path's first lesson.
The Core Idea
1The computer: processor, memory and disk
The processor runs instructions, memory (RAM) is fast and temporary, and the disk is slow and lasting. 50 gigabytes of data will not load whole into 16 gigabytes of memory, so it is read in batches. A GPU runs thousands of small operations at once, which is why deep learning trains on it.
2Programming logic in a minute
Variables hold values, conditions choose, loops repeat, and functions bundle steps under a name. That is nearly everything. The program below grades scores with the same logic as a very simple classifier:
def grade(score, threshold=60):
if score >= threshold:
return "pass"
return "fail"
scores = {"Sara": 82, "Omar": 55, "Lina": 60}
for name, score in scores.items():
print(name, grade(score))
passed = [n for n, s in scores.items() if grade(s) == "pass"]
print("passed:", len(passed), "of", len(scores))3The internet and model APIs
When your program uses a language model, it sends an HTTP request carrying JSON and receives JSON. The URL, the method (POST), the headers (the API key) and the body (the messages). Understanding this makes any model API familiar.
4The terminal, Git and environments
You will run training from the terminal, install packages in a virtual environment per project so versions do not clash, and keep the code in Git. Huge data and model weights do not go into Git; they go to separate storage.
python -m venv .venv source .venv/bin/activate # Windows: .venv\Scripts\activate pip install numpy pandas git init && git add train.py && git commit -m "First training script" echo "data/" >> .gitignore
Worked example
Problem: a 30-gigabyte data file, your machine has 16 gigabytes of memory, and pd.read_csv crashes. Analysis: the file does not fit in memory. Fix: read it in batches (chunksize=100_000) and compute what you need from each, or load only the columns you need with usecols. Understanding memory and disk solved it, not a new algorithm.
Myth vs Reality
| Myth | Reality |
|---|---|
| AI is only maths. | Most daily work is programming, data and tools. The maths comes in its time. |
| I must master everything before I start. | You need enough of a base to read and run code. The rest you learn along the way. |
Test your understanding
Where does data the program is using right now live, fast and lost when the machine powers off?
Memory is fast and temporary; the disk is lasting and slower.
Why does deep learning train on a GPU?
Training is huge matrix multiplication that spreads well across thousands of cores.
In what format does your program usually send messages to a language model API?
A POST request with a JSON body and a JSON reply.
What repeats steps for each item in a list?
A loop walks the items one by one.
Why a virtual environment per project?
Each project has its own packages and versions.
Where do you keep 5 gigabytes of model weights?
Git is for code. Huge files go to object storage or a model hub.
Quick review cards
Check Your Understanding
When do you need the stage 0 tracks?
If you could not answer this lesson's questions with confidence, or have never used the terminal and Git. And if you have never written Python, the "Python: your first language" track too.
What does memory versus disk mean for data projects?
Data bigger than memory is read from disk in batches.
What is in an API request to a model?
A URL, the POST method, a header with a key, and a JSON body with the messages.
Resources for this lesson
Grouped by type. Start with the official docs for precision, or an article or video for the explanation.
Official docs2
Done with this lesson?
Sign in to save your progress.