AI Application Development Master Class
Why Smarter. Most AI application tutorials stop at a script that sends one prompt to the
OpenAI API and prints the answer. A real application has to do much more: keep the provider’s
API key out of the browser, the logs and the repository; remember the conversation; let the LLM
call tools and then ask it again with their results; change the system prompt for each request
without saving the change; validate the JSON that comes back; stream progress to a chat window;
refuse what it must refuse; and run the same way on a laptop and in production. Smarter is a
production platform for LLM applications that does all of this, and its code is public. Its
prompt handler
speaks the OpenAI API to every provider. Its built-in functions are
tool calls with JSON Schema definitions. Its plugins
rewrite the system prompt when a prompt matches them. API keys are encrypted Secrets and
SecretStr settings, and its Proxy lets
any OpenAI SDK use a provider without ever seeing its key. The front end and the back end agree
on a chat contract
written in Pydantic, published as JSON Schema, and compiled into the TypeScript types of
Smarter Chat, a React chat app built from the
open-source @chatscope/chat-ui-kit-react, @chatscope/chat-ui-kit-styles and
@microlink/react-json-view packages.
Each of these is a decision that a developer building an AI application will meet, and each is taught here from code that runs in production, with its tests, its docstrings, the commits that fixed its mistakes, and the Architecture Decision Record that explains it. Students build a complete AI application of their own, module by module, in Docker, with Smarter beside it as the reference implementation that they read, run and compare against.
What the course covers. Eighteen one-hour modules, each a 30-minute lecture and a 30-minute lab, in six themes:
Foundations. The full-stack MVC and MVT patterns, and where an LLM, a prompt handler and a chat window fit into them; the course’s stack in Docker Compose; and fast reviews of the Python and the React that an AI application needs.
Talking to the LLM. The
openaipackage; Pydantic, and working with the JSON inside and outside theopenaipackage, including JSON mode and structured outputs; and keeping API keys and other sensitive data secret.The back end. Django REST Framework for LLM APIs; an OpenAI-compatible prompt handler that any OpenAI SDK can call; and conversations and multi-step prompts, from message history and token budgets to orchestrating several LLM calls.
Making the LLM do things. Tool calls and the tool call loop; mutating the system prompt for one request; and retrieval-augmented generation with the
langchainpackages.The front end. Streaming and progress events; a chat UI of the students’ own, built from the
@chatscope/chat-ui-kit-react,@chatscope/chat-ui-kit-stylesand@microlink/react-json-viewnpm packages; and a single-page chat web app built against a typed contract with its back end.Production. Guardrails, prompt injection and cost control; testing an AI application without calling a paid LLM; and shipping the whole stack in containers.
Look at.
smarter/smarter/apps/provider/services/text_completion/, the OpenAI-compatible prompt handler, with its tool call loop and system prompt.
smarter/smarter/apps/prompt/, the chat API, its Pydantic contract, its built-in tool functions and its progress stream.
smarter/smarter/apps/secret/ and smarter/smarter/apps/proxy/, where API keys are kept and how callers use them without seeing them.
github.com/smarter-sh/smarter-chat, the React chat app that Smarter’s LLMClient workbench is built on, and a case study in composing a chat UI from open-source packages.
Each course plan lists every file that it uses, module by module, under The Modules in the Source Code.
Read. OpenAI, OpenAI JSON Examples, Smarter Chat, Smarter Prompt, Smarter Plugin, Smarter Secret, Smarter Proxy, Smarter Guardrail, ADR 008, ADR 031.
Exercises.
Call the OpenAI API with the
openaipackage, and parse the result into a Pydantic model that rejects anything it did not ask for.Move an API key from source code into a
SecretStrsetting read from the environment, and prove that it appears in no log, response or commit.Write a Django REST Framework endpoint that accepts an OpenAI chat completion request, and call it with the official OpenAI SDK by changing only its
base_url.Give the LLM a tool with a JSON Schema definition, run the tool call loop, and test it with a fake LLM.
Add context to the system prompt of one request without saving it in the conversation’s history.
Build a chat window from
@chatscope/chat-ui-kit-react, with Markdown replies and a@microlink/react-json-viewpanel for each request, on a Vite page pointed at your own back end, and run the whole stack withdocker compose up.
Course plans. Two complete, ready-to-teach plans of 18 hours each, with a schedule, graded assignments and rubrics, two capstone projects, recommended texts, further study and technical prerequisites. This course is longer than the micro courses in this guide, and has formats of its own, described in each plan. The grading scale and the course policies are those of Course Formats and Grading. Students new to building web applications with an LLM can start with Full Stack Development with Django and React, and students who want to go deeper into Django afterwards can continue with the Django Master Class.
See the Smarter Instructor Guide to install Smarter and set up a class.