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:
- Treat LLMs as Software Infrastructure: Connect to models as stateless HTTP microservices with explicit request and response contracts.
- 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).
- 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.
- 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:
- Explain Statelessness: Describe how an LLM operates as a pure function (
f(messages) -> message) with no internal memory. - Construct Request and Response Payloads: Assemble JSON chat requests with correct message roles (
system,user,assistant) and parse response metadata (stop_reason, token usage). - Manage the History Array: Store conversation state in application memory and append new messages on each turn.
- Execute Single-Call Tasks: Apply single API calls to transform, classify, extract, summarize, evaluate, and expand data.
- Structure System Prompts: Write system prompts with four distinct sections: Persona, Runtime Context, Guardrails, and Output Contract.
- Detect and Prevent Common Errors: Identify and resolve hallucinations, format drift (markdown code fences), token truncation, and output variance.
- Run C# Code Locally: Make authenticated API calls to AWS Bedrock in the
ca-central-1region from a local .NET environment.
Workshop Materials
- Textbook: Patchbook: LLMs are just APIs (Chapters 0 through 8 cover the concepts in this session).
- C# Code: Download the Single Call C# Code (.zip). Extract the zip archive, add AWS Bedrock credentials to the
.envfile, and rundotnet run. - Slide Deck Downloads: Download the slides as a PowerPoint Presentation (.pptx) or PDF Document (.pdf).