LLM Application Engineering Foundations is a hands-on Python course in building LLM applications, from calling the OpenAI, Claude and Gemini APIs to structured output, tool calling, embeddings, basic evaluation and cost control. It suits backend and Python developers who want solid foundations before moving on to RAG and AI agents, and you leave with a working LLM app prototype of your own.
Calling an LLM API and getting an answer back takes only a few lines of code, but building an application that works in practice is another matter. Developers have to deal with answers in unpredictable formats, runaway costs, rate limits, data the model does not know, and the question of whether a prompt change actually made things better. Many teams jump straight into RAG or agent frameworks without solid foundations, which makes problems hard to fix when the system does not behave as expected.
This course builds the engineering foundations for LLM applications through hands-on Python coding. It starts with tokens, context windows and the key parameters, calling the OpenAI, Claude and Gemini APIs, managing prompts as code and enforcing output with structured output and Pydantic. Learners then let the LLM call tools and internal APIs, work with embeddings and semantic search on a vector database, and write code that
can switch between providers or in-house models. The course then turns to what makes an app ready for use: evaluation with test sets, cost and latency control, error handling and security, and logging. It closes with a capstone LLM application that is ready to grow into the RAG and AI agent courses. (3 days, 6 hours per day, 18 hours in total, Beginner to Intermediate level.)
What you’ll gain
Explain how LLMs work from a developer's point of view, including tokens, context windows and key parameters
Call the OpenAI, Claude and Gemini APIs from Python, both standard and streaming
Enforce output that matches a schema with structured output and validate it with Pydantic
Design tool calling so the LLM can use internal APIs and databases safely
Use embeddings and a vector database for semantic search
Evaluate LLM applications with test sets, automated checks and LLM-as-a-judge
Control the cost, latency, errors and security of LLM applications
Who this course is for
Backend and full-stack developers starting to bring LLMs into their applications
Python developers who want solid foundations before learning RAG and AI agents
Data engineers and data scientists who use LLMs to extract or classify data
Tech leads who set the team's approach to writing code that uses LLMs
Students and career changers with Python skills who want to become AI engineers
Prerequisites
Python skills such as functions, classes, virtual environments and installing packages
An understanding of REST APIs and JSON, and basic Git
Experience using ChatGPT, Claude or Gemini at work
A laptop that can run Python and VS Code, with an API key from at least one provider
Curriculum
Course Details
This course runs for 3 days, 6 hours per day (18 hours in total, 09:00-16:00), as lectures with Python coding labs that build on one service throughout. Beginner to Intermediate level. Learners use API keys from their own or company accounts and cover their own API costs, and the labs can be done with a single provider or with in-house models through Ollama. The course is the entry point to the LLM engineering track, laying foundations in APIs, structured output, tool calling, embeddings, evaluation and cost before moving on to the RAG & Knowledge Base and AI Agents for Business courses. Learners take home a lab guide, sample code for every lab and a capstone project template.
Day 1LLM APIs and Output Your Code Can Use
Section 1: LLMs from a Developer's Point of View
How LLMs work as a developer needs to know it: tokens, next-token prediction and the context window
Temperature, max tokens and the parameters that shape answers
Choosing models for the task: large, small and reasoning models
Token-based pricing and estimating cost at design time
Lab: count tokens for Thai and English text and compare the cost
Section 2: Lab: Calling LLM APIs from Python
Set up a Python project and store API keys safely in environment variables
Call the OpenAI, Claude and Gemini APIs through their official SDKs
Message roles: system, user and assistant, and keeping conversation history
Streaming answers so users see results sooner
Comparing the API styles of each provider
Section 3: Prompts as Code
Separate prompts from code with templates and variables
Write clear system prompts and use few-shot examples
Version prompts in Git just like code
Pass long inputs into the context in a structured way without exceeding the context window
Lab: build a team prompt library with usage examples
Section 4: Lab: Structured Output
Why asking for JSON in the prompt alone is not enough
Define schemas with Pydantic and use each provider's structured output feature
Validate output, handle schema mismatches and retry within limits
Design schemas that are easy for the model, such as enums and well-described fields
Lab: extract data from Thai emails and quotations into JSON
Section 5: Lab: An Extraction Service with FastAPI
Wrap LLM calls in a REST API with FastAPI
Accept files or text and return results that match a schema
Set timeouts and return errors that callers can understand
Test the API with Swagger UI and pytest
Lab: build a service that classifies and summarises customer complaints
Day 2Tool Calling, Embeddings and Switching Models
Section 6: Tool Calling
How tool calling works: the model chooses the tool, but your code makes the call
Write tool descriptions and parameter schemas that help the model choose correctly
The loop of repeated tool calls, and calling several tools at once
Handling failed tools and invalid arguments
Lab: let the LLM call calculation and product lookup functions
Section 7: Lab: An Assistant That Calls Internal APIs
Connect the LLM to the order database and internal APIs of a sample business
Limit tool permissions: read-only by default and confirmation before changing data
Cap the number of rounds to prevent endless loops and control cost
An overview of MCP as a standard for connecting tools, and where this leads to agents
Lab: an assistant that answers order status from real data in the database
Section 8: Embeddings and Semantic Search
What embeddings are and how text similarity is measured
Choosing an embedding model that handles Thai, and the trade-off between dimensions and cost
Splitting documents into chunks, and how chunk size affects search quality
Uses beyond RAG: finding duplicate questions, clustering and recommendations
Lab: embed frequently asked questions and search them by meaning
Section 9: Lab: Vector Database Basics
An overview of vector databases and how to choose one, such as Chroma and pgvector
Store documents with metadata and search with filters
Indexes for fast search and the trade-off with accuracy
Combine search results with the LLM's answer as a simple RAG pattern
Lab: a semantic search system for product manuals on pgvector
Section 10: Lab: Writing Code That Can Switch Models
Provider differences to watch for: message format, tools and structured output
Use OpenAI-compatible endpoints and the LiteLLM SDK to call several providers with one codebase
Run in-house models with Ollama for development and for data that must not leave the machine
Design a team abstraction layer that is not tied to a single provider
Lab: move the day one classification service to another provider and to an in-house model
Day 3Evaluation, Cost Control and Production Readiness
Section 11: Lab: Basic Evaluation of LLM Apps
Why you need a test set before changing a prompt or a model
Build a test set from real examples with expected answers
Automated rule-based checks such as schema match, key terms and correct figures
LLM-as-a-judge for free-text answers, and the limits to know
Lab: run the test set in pytest to compare two prompt versions
Section 12: Controlling Cost and Latency
Measure cost per request and per user from actual token counts
Prompt caching and ordering prompts so the cache can be used
Batch APIs for work that does not need an immediate answer
Use small models for easy tasks and send hard ones to large models
Lab: cut the cost of the day one service and measure before and after
Section 13: Errors, Rate Limits and Security
Handle rate limits and transient errors with exponential backoff retries
Timeouts, fallback to a backup model and user messages when things fail
Basic prompt injection, and keeping instructions separate from user data
Personal data and PDPA: what may be sent, what to mask and how to log it
Managing API keys across a team and rotating them
Section 14: Lab: Logging and Tracing LLM Apps
Record the prompt, answer, tokens, latency and cost of every request
Set up traces that show the steps of tool calling and search
Use logs to find poorly answered questions and add them to the test set
Balance log detail against privacy
Section 15: Capstone: Your Own LLM App
Design a small LLM app from your own work or a sample brief
Use at least two of structured output, tool calling and semantic search
Build a test set, measure cost and handle errors fully
Present the work, review it together and map the path on to RAG and AI agents
Schedule & training options
For individuals — public rounds
No public rounds are open right now. Join the waiting list and we will contact you first when the next round opens, or ask us on LINE. Or call 02-570-8449 or 088-807-9770
What is structured output from an LLM, and what is it used for?
Structured output forces an LLM to reply with JSON that matches a defined schema instead of free text, so your code can use the result directly, for example extracting names, dates and amounts from emails into a database. In Python the schema is usually defined with Pydantic, passed to the provider's API, and the result validated with Pydantic again before use.
How does tool calling work with an LLM?
The developer declares tools with a name, description and parameter schema and sends them with the request. When the model needs more information, it replies with a tool call and arguments. Your code then calls the real API or database and sends the result back so the model can write its answer. The model never runs anything itself, so validate the arguments and limit each tool's permissions.
What are embeddings, and how are they used for semantic search?
An embedding turns text into a numeric vector, where texts with similar meanings have vectors close together. For semantic search, you embed all your documents and store them in a vector database, then embed each question and retrieve the closest documents using a measure such as cosine similarity. This finds relevant text even when different words are used, and it is the foundation of RAG.
Who is the LLM Application Engineering Foundations course for, and what should I know beforehand?
It suits backend and full-stack developers starting to add LLMs to their applications, Python developers who want solid foundations before RAG and AI agents, and students or career changers with Python skills. You should write Python, including functions, classes and virtual environments, understand REST APIs and JSON, use Git at a basic level, and have used ChatGPT, Claude or Gemini at work.
What will I be able to do after the LLM Application Engineering Foundations course?
You will be able to call the OpenAI, Claude and Gemini APIs from Python with and without streaming, enforce schemas with structured output and Pydantic, design safe tool calling against internal APIs, build semantic search with embeddings and a vector database, and evaluate, control costs and handle errors in LLM applications. Participants who complete the training receive a Certificate of Completion with its own number, which can be verified online.
What do I need to bring for LLM Application Engineering Foundations?
Bring a laptop that can run Python and VS Code, plus an API key from at least one provider on your own or your organisation's account. API usage costs are your own responsibility. The labs work with a single provider, or you can use a local model through Ollama instead.
RAG systems built on vector search alone answer well when the answer sits in a single passage, but they often miss when a question has to connect several documents, such as which product models a customer uses that are affected by the latest notice, or when…
General AI models are strong at language but do not know your organization's internal information - manuals, policies, contracts, customer data or accumulated know-how. When asked something specific to the organization, AI often answers incorrectly…
Organizations have mostly used AI in a question-and-answer style: a person asks, AI answers, and the person then does the follow-up work every time. Today AI has moved beyond an assistant waiting for commands to an AI agent that takes a goal in human language…
12 hours2 days
8,910THB9,900 THB
View details
LLM Application Engineering Foundations18 hrs · 3 days