Skip to content
Ameen Abozaid
Planned lessonJNR-056-L01

What happens in an LLM API call

  • Lesson 1 of 7
  • Junior
On This Lesson 4 topics

This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.

In this lesson

understand what your code sends and receives.

Planned topics

  • An LLM API is an HTTP call: you send a list of messages, you get a reply message back.
  • A system message sets the rules and role. User messages carry the request. Earlier assistant messages are context.
  • Model parameters such as temperature (randomness) and a maximum output length shape the reply.
  • Text is counted in tokens (word pieces). Cost and limits depend on input plus output tokens.
  • Output is probabilistic: the same input can give different text, so never assume the format.
Draft outline details

Demonstration

json
{ "model": "<configured>",
  "messages": [
    {"role":"system","content":"You write short product descriptions."},
    {"role":"user","content":"Wireless mouse, 2.4 GHz, black"} ],
  "max_tokens": 150 }

Check your understanding

What do you pay for?

Show answer

Tokens sent and tokens received.

Practice

Apply this lesson with the module's lab, exercises and quiz.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Continue to next lesson

Type to search levels, phases, modules and lessons.