CS I · Mon Oct 26 · 13.1 · Do Now

How AI Gets Packaged

Open the discussion form on the right and answer Section 1 from your first reading.

Announcements

Input, Processing and Output

This section reviews what the class has learned about AI and then explains how a model is packaged into a tool that people can use.

What the Class Has Learned About AI

This semester, the class has spent a lot of time understanding AI. First, the class learned that a language model is two files: a large parameter file of numbers and a smaller program called a runtime. Next, the class learned that a model generates new text one token at a time and does not retrieve a stored answer. After that, the class learned that the models in this course run on a server, not on the Chromebook, because the class models need far more memory than a Chromebook has. Last week, the class listed the parts it takes to turn a model into a tool: an interface, a request, a server, a system prompt, the model and a response. This lesson turns to how AI gets packaged and made available to people.

Three Parts of Every Tool

Every computer tool can be described in three parts. Input is the data that goes into a tool. For example, when a person presses the keys for 12 + 30 on a calculator, the numbers and the plus sign are the input. Processing is the work done on the input. In a calculator, the processing is the arithmetic that adds 12 and 30. Output is what comes out of the tool after the processing, and in the calculator the output is 42 on the display. An OpenStax computer science textbook describes the same pattern in a computer. Input devices take input from a user, the processor carries out the program's instructions, and output devices turn the results into a form such as a picture on the screen.

Input, Processing and Output in an AI Tool

A tool that uses a model has the same three parts, and its input is the text the user types. The directions printed on a tool's page are not input, because input is what the user gives the tool. The processing is done by the model, and in this course's tools the model runs on a server. The model predicts the answer one token at a time from its parameters, and the output is the generated text that the page displays.

The Name That Element page of MuggsAI is one example from this class. A student types a description of something on a screen, such as a box that pops up over a page, and presses the button labeled Name it. That description is the input. Next, the class site's server places a system prompt before the student's text and sends both to a Mistral model. The system prompt does not count as input, because the builder writes it ahead of time and the server sends it with the input on every request. Then the model does the processing, and the element name it generates is the output. The page that shows the answer does not do the processing, since it only displays what came back. The description the student typed is not output either, even though it stays on the screen. Figure 1 shows the three parts in order, with the system prompt and the input traveling together into the model.

The Programs Around the Model

Apart from the model and the system prompt, every part of the tool is an ordinary program. These programs include the page in the browser, the server code that receives the request, adds the system prompt and calls the model, and the code that carries the answer back to the page. Mistral's documentation describes what the server code has to build. Each request names the model to use and carries a list of messages, and each message has a role, such as system or user. The response carries the generated message, which the server code reads and passes back to the page.

People write these programs in programming languages. A programmer writes the instructions as source code in plain text files, and the computer runs the finished program. Packaging AI is mostly this work. The model does the processing, while programs written by people carry the input in and the output out. Two tools can use the same model and still behave differently, because each tool has its own system prompt.

Java is one of the programming languages used to write programs that run on servers. The rest of this week is about Java: where it came from, why it is used, where it runs and why it matters for AP Computer Science A.

Summary

Every tool has input, processing and output. In a tool that uses a model, the user's text is the input, the model does the processing on a server, and the generated text is the output. The page and the server code around the model are ordinary programs that people write in a programming language, and Java is one of those languages.

Sources: Franchitti, Introduction to Computer Science, OpenStax (2024); Mistral AI, Chat completions and API reference (n.d.); Oracle, About the Java Technology (n.d.); Oracle, The Java EE Tutorial (2014); Week 12 passages and MuggsAI request path, class site (2026).

I Do questions
  1. notebook cue: input

    A student types a question into an AI study app and clicks Ask. What is the input, and who gives it to the tool?

    Check

    The input is the question the student typed, and the student gives it to the tool. Input is what the user gives the tool, so the directions printed on the app's page are not input. See Three Parts of Every Tool, paragraph 1, and Input, Processing and Output in an AI Tool, paragraph 1.

  2. notebook cue: processing

    In a tool that uses a model, which part does the processing: the page on the screen or the model on a server?

    Check

    The model on a server does the processing. It generates the answer one token at a time, and the page only shows what came back. See Input, Processing and Output in an AI Tool, paragraphs 1 and 2.

  3. notebook cue: output

    The app shows an answer under the question the student typed. Which part of the screen is the output, and which part is not?

    Check

    The answer is the output, because it is the text the model generated. The question the student typed is not output, even though it stays on the screen, because it is the input. See Input, Processing and Output in an AI Tool, paragraph 2.

Figure 1. In a tool that uses a model, programs written by people carry the input in and the output out, and the model on a server does the processing.

The big picture so far (newest on top)

Big picture 4 of 5. Walls you can't see. Around the chain from Big picture 3 sit three walls: sources behind a login that the search can't open, a training gap shaped by crawler blocks and licensing deals, and policy rules that can look like missing information.
Big picture 3 of 5. Generation and retrieval. In Google's AI Mode, Lens reads the image, Search fetches pages from the open web (retrieval), and Gemini writes the answer from its squeezed chunk (generation), with links back to the pages.
Big picture 2 of 5. The song ladder. On each rung the gaps get bigger and less is really known, but the model sings every rung in the same confident voice. On rung 4 a word gets "picked anyway," which people call a hallucination.
Big picture 1 of 5 (from 12.2). Training squeezes one chunk of the internet into a much smaller parameters file and loses details; probability fills the gaps when the model is used.
I Do questions
  1. notebook cue: input

    A student types a question into an AI study app and clicks Ask. What is the input, and who gives it to the tool?

    Check

    The input is the question the student typed, and the student gives it to the tool. Input is what the user gives the tool, so the directions printed on the app's page are not input. See Three Parts of Every Tool, paragraph 1, and Input, Processing and Output in an AI Tool, paragraph 1.

  2. notebook cue: processing

    In a tool that uses a model, which part does the processing: the page on the screen or the model on a server?

    Check

    The model on a server does the processing. It generates the answer one token at a time, and the page only shows what came back. See Input, Processing and Output in an AI Tool, paragraphs 1 and 2.

  3. notebook cue: output

    The app shows an answer under the question the student typed. Which part of the screen is the output, and which part is not?

    Check

    The answer is the output, because it is the text the model generated. The question the student typed is not output, even though it stays on the screen, because it is the input. See Input, Processing and Output in an AI Tool, paragraph 2.

Input, Processing and Output

This section reviews what the class has learned about AI and then explains how a model is packaged into a tool that people can use.

What the Class Has Learned About AI

This semester, the class has spent a lot of time understanding AI. First, the class learned that a language model is two files: a large parameter file of numbers and a smaller program called a runtime. Next, the class learned that a model generates new text one token at a time and does not retrieve a stored answer. After that, the class learned that the models in this course run on a server, not on the Chromebook, because the class models need far more memory than a Chromebook has. Last week, the class listed the parts it takes to turn a model into a tool: an interface, a request, a server, a system prompt, the model and a response. This lesson turns to how AI gets packaged and made available to people.

Three Parts of Every Tool

Every computer tool can be described in three parts. Input is the data that goes into a tool. For example, when a person presses the keys for 12 + 30 on a calculator, the numbers and the plus sign are the input. Processing is the work done on the input. In a calculator, the processing is the arithmetic that adds 12 and 30. Output is what comes out of the tool after the processing, and in the calculator the output is 42 on the display. An OpenStax computer science textbook describes the same pattern in a computer. Input devices take input from a user, the processor carries out the program's instructions, and output devices turn the results into a form such as a picture on the screen.

Input, Processing and Output in an AI Tool

A tool that uses a model has the same three parts, and its input is the text the user types. The directions printed on a tool's page are not input, because input is what the user gives the tool. The processing is done by the model, and in this course's tools the model runs on a server. The model predicts the answer one token at a time from its parameters, and the output is the generated text that the page displays.

The Name That Element page of MuggsAI is one example from this class. A student types a description of something on a screen, such as a box that pops up over a page, and presses the button labeled Name it. That description is the input. Next, the class site's server places a system prompt before the student's text and sends both to a Mistral model. The system prompt does not count as input, because the builder writes it ahead of time and the server sends it with the input on every request. Then the model does the processing, and the element name it generates is the output. The page that shows the answer does not do the processing, since it only displays what came back. The description the student typed is not output either, even though it stays on the screen. Figure 1 shows the three parts in order, with the system prompt and the input traveling together into the model.

The Programs Around the Model

Apart from the model and the system prompt, every part of the tool is an ordinary program. These programs include the page in the browser, the server code that receives the request, adds the system prompt and calls the model, and the code that carries the answer back to the page. Mistral's documentation describes what the server code has to build. Each request names the model to use and carries a list of messages, and each message has a role, such as system or user. The response carries the generated message, which the server code reads and passes back to the page.

People write these programs in programming languages. A programmer writes the instructions as source code in plain text files, and the computer runs the finished program. Packaging AI is mostly this work. The model does the processing, while programs written by people carry the input in and the output out. Two tools can use the same model and still behave differently, because each tool has its own system prompt.

Java is one of the programming languages used to write programs that run on servers. The rest of this week is about Java: where it came from, why it is used, where it runs and why it matters for AP Computer Science A.

Summary

Every tool has input, processing and output. In a tool that uses a model, the user's text is the input, the model does the processing on a server, and the generated text is the output. The page and the server code around the model are ordinary programs that people write in a programming language, and Java is one of those languages.

Sources: Franchitti, Introduction to Computer Science, OpenStax (2024); Mistral AI, Chat completions and API reference (n.d.); Oracle, About the Java Technology (n.d.); Oracle, The Java EE Tutorial (2014); Week 12 passages and MuggsAI request path, class site (2026).

Table Talk
You open an app and ask its AI a question. Besides the model, what else had to be built so that you could ask? Name two things.

Each table lists everything besides the model that had to exist for the question to reach it, and agrees on which item on the list matters most.

Chromebooks stay closed while your table talks. Sections 1 and 2 of the discussion form are already done. After you talk, finish Section 3 right here under My View. Submit before the exit ticket.

This form has three sections. Section 1: answer today's Board Question. Section 2: after the reading. Section 3 opens later in class. Today's Board Question: You open an app and ask its AI a question. Besides the model, what else had to be built so that you could ask? Name two things.

CR 1. Board Question: You open an app and ask its AI a question. Besides the model, what else had to be built so that you could ask? Name two things. Give your answer and one reason.

Write your answer in your lab notebook, labeled CR 1.

MC 1. Think about your answer to the board question. You open an app and ask its AI a question. Besides the model, what else had to be built so that you could ask? Name two things. Which position is closest to yours now?

  • Only the model. Everything else is just the screen.
  • The model, plus programs written by people that carry the question in and the answer out.
  • Nothing else. The AI runs inside the phone by itself.

MC 2. (Statement 1) Every part of an AI app was made by training on examples.

  • Agree
  • Disagree

MC 3. (Statement 2) In a tool that uses a model, the model does the processing.

  • Agree
  • Disagree

MC 4. (Statement 3) People still write the programs that carry a question to a model and the answer back.

  • Agree
  • Disagree

CR 2. (A different view) Write the view at your table that was most different from yours. If everyone agreed, write the strongest argument against your table's answer.

Write your answer in your lab notebook, labeled CR 2.

CR 3. Think about the Board Question again: You open an app and ask its AI a question. Besides the model, what else had to be built so that you could ask? Name two things. Do you have the same opinion as when you first answered the board question? If it is the same, what from the reading or table talk reaffirmed your opinion? If it is different, what from the reading or table talk changed your opinion?

Write your answer in your lab notebook, labeled CR 3.