Using LLMs in Large Language Models

Lessons in this section

  1. Hallucinations

    Why LLMs make up facts that sound right, how to spot low-confidence tokens, and how to reduce hallucinations with given context, permission to say I don't know, and checks.

  2. JSON Validation

    How to get JSON from an LLM and check it: parse it, check required keys and allowed values, clean common wrappers, and find the temperature where JSON starts to break.

  3. LLM APIs

    How code talks to an LLM: the chat messages format, request settings, streaming replies, token usage and cost, errors and retries, with WebLLM and cloud services.