Day 5 - Jan 25 2026

First LLM Call (Hello World)

1. The Anatomy of an LLM Call

When we talk to an AI via code, we aren't just sending text; we are constructing a Payload.

  • Model: Specifies which "brain" to use (e.g., llama3.2, gpt-4).

  • Messages: A list of dictionaries representing the conversation history.

    • role: "user" → My input.

    • role: "assistant" → The AI's previous answers.

    • role: "system" → Instructions on how the AI should behave (we will cover this tomorrow).

2. The Response Object

The AI doesn't just return a string. It returns a JSON Object containing:

  • model: The name of the model used.

  • created_at: Timestamp.

  • message: The actual content (this is what we extract).

  • done: Boolean status.

3. Why Local (Ollama)?

I chose to use Ollama for this stage because:

  • Zero Latency: No internet lag.

  • Zero Cost: I can test a loop of 100 calls without paying $0.01.

  • Privacy: My prompts (which might eventually contain private data) never leave my machine.

Status:

Last updated