Do Now · Lab Notebook · 10 minutes

Set up your notebook. You will need it at the end of class.

Terminology and Concepts to look out for

Copy these. Leave space under each one for a definition.

  • program
  • runtime
  • operating system
Relevance to Me

Think about these. Nothing to write.

  • When you open a photo, something opens it. Do you know what?
  • Have you ever had a file your device could not open?
  • Who wrote the app you use most? Do you know anything about them?
Question of the Day

Copy this into your Lab Notebook and leave room under it. You will answer it at the end of class.

What actually opens the file and makes it run?

Before the reading

The words, in plain terms

Yesterday was the parts. Today is the software that sits on them. Still not the AI part.

program
A list of steps a machine can carry out.
Open one in a text editor and you can often see the steps. They look like language because they are language.
In a gameThe .exe you launch.
runtime
The program that opens the file and does arithmetic with the numbers inside it.
The model file has no instructions in it, so something with real instructions has to read it. In this room that is LM Studio, with llama.cpp underneath doing the work.
In a gameA game engine like Unity or Unreal. The maps are not the engine — the engine reads them.
operating system
OS — operating system
The software that starts when the power comes on and decides what else is allowed to be installed.
Windows is one. macOS is one. Linux is one. A Chromebook runs ChromeOS, and that is where the third failure comes from.
In a gameWhy a game is listed Windows only.
What Opens It

Yesterday ended with a file that fits and does nothing.

The arithmetic worked out. Three machines in the world could hold 6.63 gigabytes in the right place, and a Chromebook could not. But even on a machine with room to spare, copying the file over and waiting produces no answers, no output, and no sign that anything has happened at all. Something is missing, and it is not hardware.

Open the file and look at it. Not run it. Open it, the way you would open a text file, and read what is inside.

What comes back is unreadable. Not unreadable in the sense of a foreign language, where the words are words and you simply do not know them. Unreadable in the sense that there are no words. There are numbers, an enormous quantity of them, and nothing that looks like a sentence or a command or an instruction anywhere in the file.

That is worth sitting with, because most people assume software is a set of instructions. And usually it is. A program is a list of steps a machine can carry out: check this, then do that, then show the result. Open a program in a text editor and you can often see the steps, even if you do not understand them. They look like language because they are language.

The model file is not that. It is a record of numbers with no instructions in it whatsoever, which means no machine on earth can simply run it, in the way a machine runs a program. There is nothing to follow.

So something else has to happen. Some piece of actual software, one that is a real program with real instructions in it, has to open the file, read those numbers, and do arithmetic with them. That piece of software is called a runtime, and it is a completely separate thing from the file it opens.

This is the sentence the day is built on. The file is not the software. The software is not the file. They arrive from different places, they are made by different people, and either one can be replaced without touching the other.

In this classroom the runtime has a name and a window you can see. It is called LM Studio, and when the model on the teacher’s machine produces an answer, LM Studio is the thing doing the reading.

But LM Studio is not the whole story. Underneath it sits another piece of software called llama.cpp, which is the part that actually does the work of reading the numbers and running the arithmetic. LM Studio is a window built on top of it. Click a button in LM Studio and llama.cpp is what responds.

Which means there are two different ways to run the identical file. A person can install LM Studio and click, or install llama.cpp on its own and type commands into it instead. Same file, same engine underneath, different amount of software standing between the person and the machine. The file has no opinion about which one a person chooses, because the file does not know either of them exists.

Underneath all of it there is one more layer, and it decides whether any of this is possible at all. Every machine runs an operating system, the software that starts when the power comes on and that lets other software be installed and run. Windows is one. macOS is one. Linux is one.

A Chromebook runs ChromeOS, and this is where the machine fails a third time.

The first failure was storage, and a student could imagine fixing it by deleting things. The second was RAM, and there is nothing to delete that would help. The third is different from both. ChromeOS does not permit software like LM Studio or llama.cpp to be installed on a school-managed device. Not because the file is too large. Not because the machine is too slow. Because the operating system will not allow the runtime to exist there in the first place.

Three failures, three different reasons, and only the first one looks like a number problem.

There is one more thing worth noticing before the period ends, and it has nothing to do with any of these machines.

Somebody made the file and gave it away. Somebody else, entirely unconnected, wrote the software that opens it and gave that away too. A third group built the card the whole thing runs on, for people who wanted to play video games. None of these people know each other. None of them were working on this class.

And the thing still runs.

So when a person says they are running their own AI, what exactly is the part that belongs to them?

Work these together
10 questions on the passage. Pick an answer, then check it. Nothing here is collected.
Question 1 of 10the passage
The passage describes opening the model file and reading what is inside. What is there?
Question 2 of 10the passage
According to the passage, what is a runtime?
Question 3 of 10the passage
What does the passage say an operating system is?
Question 4 of 10the passage
The passage says LM Studio is not the whole story. What sits underneath it?
Question 5 of 10the passage
A person installs llama.cpp on its own, with no LM Studio. According to the passage, what happens to the model file?
Question 6 of 10the passage
The passage says the Chromebook fails a third time. What is the third reason?
Question 7 of 10the passage
Which list puts the three Chromebook failures in the order the class met them?
Question 8 of 10the passage
Which of these could a student change to make a Chromebook run the file?
Question 9 of 10the passage
The passage names three groups of people who made the pieces of a working setup. Which best describes their relationship?
Question 10 of 10the passage
Based on the passage, why is the separation between the file and the software important?
The pictures
A program and a model file Two files side by side. The program file contains readable instructions a machine can follow. The model file contains rows of numbers and no instructions at all. A PROGRAM THE MODEL FILE if answer is empty: ask again else: show the answer stop Instructions. Steps a machine can follow, in order, one after another. 0.0142 -0.9931 0.4408 -0.1176 -0.7725 0.0038 0.6621 0.2094 0.3310 -0.4457 -0.0089 0.8812 -0.2201 0.7736 0.1150 -0.6674 0.9084 -0.0512 0.3397 0.0261 -0.4419 0.6103 -0.8850 0.1928 ... and billions more No instructions anywhere in it. Nothing here can be followed. A machine can run the one on the left. Nothing can run the one on the right until something reads it.
Numbers, not instructions — a program (readable lines) beside the model file (rows of numbers).
Read the picture

Both sides are files. Only one of them is a program.

On the left are instructions: steps a machine can carry out, in order, one after another. You do not have to understand what the program does to see that it is telling something to do something.

On the right is the model file. There are no steps. There is no order. There is nothing to carry out. It is a record of numbers, billions of them, and a machine handed this file has been given no instructions at all.

That is why yesterday ended with a file that fits on three machines and does nothing on any of them. Fitting was never the last problem.

The software stack A machine contains an operating system, which contains a runtime, which holds the model file. Four layers, each inside the one above it. The machine Windows, macOS or Linux the runtime reads the numbers and does the arithmetic the file numbers, no instructions, 6.63 GB Four layers, each inside the one above it. Take any one away and nothing answers.
The software stack — the machine contains the OS, which contains the runtime, which holds the file. Four layers.
Read the picture

Four layers, each one sitting inside the one above it.

The machine is the hardware. The operating system is the software that starts when the power comes on and decides what else is allowed to run. The runtime is a real program, with real instructions in it, whose whole job is to open a file that has none. The file sits inside the runtime because the runtime is the only thing that can do anything with it.

Take any one layer away and nothing answers. That is worth testing on yourself: pick a layer, remove it, and say what breaks.

Same file, same engine Two stacks side by side. Both hold the same model file and the same engine, llama.cpp. The left stack adds LM Studio as a window on top. The right stack has no window and is typed into directly. WITH A WINDOW WITHOUT ONE LM Studio llama.cpp the file 6.63 GB, identical You click. llama.cpp the file 6.63 GB, identical You type. Same file. Same engine. The only difference is how much software stands between you and it. The file does not know either of them exists.
Same file, same engine — LM Studio on top of llama.cpp on one side, llama.cpp alone on the other.
Read the picture

Both sides are running the identical file, and both sides are running the identical engine.

llama.cpp is the engine. It is the software that actually reads the numbers and does the arithmetic. On the left, LM Studio sits on top of it as a window, so a person clicks. On the right there is no window, so a person types instead. That is the entire difference.

The file has no opinion about any of this, because the file does not know either program exists. Two things that can be swapped without touching each other were never one thing.

This is the point the rest of the unit rests on. Somebody made the file. Somebody unconnected wrote the engine. A third group built the card, aiming it at people who play video games. None of them know each other, and the thing still runs.

The Chromebook The same stack drawn again with the runtime box empty and outlined in dashes. The model file sits in storage inside the machine, perfectly intact, because there is nothing above it that can open it. The machine ChromeOS no runtime and no way to install one Nothing here to read the numbers. Storage the file, 6.63 GB The same picture, with one box empty. The file downloads fine and sits there like any other file. It just never gets copied up. Not too small. Not too slow. Not allowed.
The hole — the same stack with the runtime box empty. Chromebook. Not too small, not too slow, not allowed.
Read the picture

This is the same picture as the software stack, with one box empty. Compare them directly. The machine is the same size, the operating system region is the same size, and the runtime box is in exactly the same place.

What changed is that the box is empty and cannot be filled. ChromeOS does not permit software like LM Studio or llama.cpp to be installed on a school-managed device.

The file has moved outside the machine, because there is nothing in there that could open it.

This is the Chromebook’s third failure and it is different in kind from the other two. The first was storage, and deleting things would fix it. The second was RAM, and nothing you delete would help. This one is not about a number at all. Not too small, not too slow, not allowed.

What opens it
The pictures are numbered on the left. Each question says which one it is about.
The words, in plain terms
program
A list of steps a machine can carry out.
Open one in a text editor and you can often see the steps. They look like language because they are language.
In a gameThe .exe you launch.
runtime
The program that opens the file and does arithmetic with the numbers inside it.
The model file has no instructions in it, so something with real instructions has to read it. In this room that is LM Studio, with llama.cpp underneath doing the work.
In a gameA game engine like Unity or Unreal. The maps are not the engine — the engine reads them.
operating system
OS — operating system
The software that starts when the power comes on and decides what else is allowed to be installed.
Windows is one. macOS is one. Linux is one. A Chromebook runs ChromeOS, and that is where the third failure comes from.
In a gameWhy a game is listed Windows only.
Yesterday's file, opened.
A program next to the model file: instructions on one side, numbers on the other. This closes yesterday's open ask and it is the most convincing object in the day.
Ask

So what does it take to make the file do something?

Reveal

Real software with real instructions in it. Something has to read the numbers and do arithmetic on them.

A runtime is what reads it.
The word arrives here, after the need for it. Four layers, and taking any one away leaves nothing that answers.
There is more than one way to run it.
llama.cpp is the engine. LM Studio is a window on top of it, and it is what the rig runs.
Ask

Does the file care which one opens it?

Reveal

No. The file does not know either of them exists.

The separation is the point.
Someone published the file for free. Someone else wrote the software. A third group built the card, for people who play video games. None of them know each other.
Open ask

So is it yours?

We are not answering this today either. This one comes back all six days.

The third failure.
ChromeOS will not permit a runtime on a school-managed device.
Ask

Could you fix it by buying more storage?

Reveal

No. Not too small, not too slow, not allowed.

The rest of the block

Partner work first. Then quiet work time.

The three rules
  • No cellphones
  • No sleeping
  • No non-academic use of Chromebooks
What you get
  • A quiet room and music
  • No interruptions from the teacher
  • If you are caught up on this course's work, you may work on anything legitimate for another class
If you are picking, pick reading or writing.
Everything we build in this class, we build with words. The tools take writing as input. How well you write is the ceiling on what you can make them do.
Open this now: muggsofcompsci.net/decks/cs1-stack-day2-wedo