Session 1: Understanding the Model & The Single Call

Presentation slides for Large Language Models for Software Engineers (Session 1).

Downloads: PowerPoint Presentation (.pptx) · PDF Slides (.pdf) · C# Single Call Code (.zip)


Workshop Series Learning Outcomes

When participants complete this three-session workshop series, they will be able to:

  1. Treat LLMs as Software Infrastructure: Connect to models as stateless HTTP microservices with explicit request and response contracts.
  2. Build Applications from First Principles: Implement the three basic parts of an LLM system: the Model (remote text generation), the Harness (application logic and memory), and Tools (database and API functions).
  3. Control Developer Agent Tools: Diagnose, debug, and improve interactions with coding tools (such as Cursor, Claude Code, and Copilot) by understanding prompt assembly, tool execution, and context limits.
  4. Prevent Production Failures: Design software that prevents hallucinations, format drift, token truncation, and prompt injection.

Session 1 Objectives

This session explains the basic software model for LLMs. It demonstrates tasks that a single stateless API call can complete before you write multi-turn loops.

Specific Outcomes for Session 1:

  1. Explain Statelessness: Describe how an LLM operates as a pure function (f(messages) -> message) with no internal memory.
  2. Construct Request and Response Payloads: Assemble JSON chat requests with correct message roles (system, user, assistant) and parse response metadata (stop_reason, token usage).
  3. Manage the History Array: Store conversation state in application memory and append new messages on each turn.
  4. Execute Single-Call Tasks: Apply single API calls to transform, classify, extract, summarize, evaluate, and expand data.
  5. Structure System Prompts: Write system prompts with four distinct sections: Persona, Runtime Context, Guardrails, and Output Contract.
  6. Detect and Prevent Common Errors: Identify and resolve hallucinations, format drift (markdown code fences), token truncation, and output variance.
  7. Run C# Code Locally: Make authenticated API calls to AWS Bedrock in the ca-central-1 region from a local .NET environment.

Workshop Materials