The first call to a language model API takes about ten minutes. Everything after that is the actual work: output that will not parse, a tool called with the wrong argument, a request that hangs, a bill nobody forecast, and a user who has discovered that pasting instructions into a support ticket makes interesting things happen. This course is two days on that second part, written for developers who have to put an AI feature in front of real users and then keep it running.

You work in Python against both the OpenAI and Anthropic APIs, close enough together to see where the two differ and where the pattern is identical. Day one covers the request and the response in detail: system prompts and message history, token limits and stop conditions, streaming into a user interface, reading usage back so a request can be costed, and a thin client wrapper that keeps keys out of the codebase. Then structured output against a JSON schema, validated before anything downstream is allowed to see it, and the tool-use loop: writing a tool definition the model calls with the right arguments, executing the call, returning the result, and constraining what a tool may do when its side effects cannot be undone.

Day two opens on retrieval, treated as an engineering problem rather than an architecture diagram. You chunk documents so an answer is not cut in half at a page break, index them with an embedding model, query a vector store, and add reranking for the cases where pure vector search confidently returns the wrong passage. You add citations and a grounded refusal, so the feature says it does not know rather than filling the gap. The session also covers the Model Context Protocol as a standard way of exposing tools and data to a client that supports it.

The final half day is what separates a demonstration from a service. You build an evaluation suite from real failures, with deterministic assertions where the answer is checkable and a model-graded rubric where it is not, and wire it into CI so a prompt change cannot regress in silence. You reduce cost and latency with prompt caching, batch requests, tiered model choice and a shorter context, and you measure the difference rather than assuming it. You handle rate limits, timeouts and provider outages with backoff, fallback and idempotent retries, and you defend the endpoint against instructions hidden in untrusted content.

You leave with a repository you built during the two days: an endpoint that streams, calls tools, retrieves from a document set, is covered by an evaluation suite and reports its cost per request. Bring your own API keys, since the exercises use a small amount of credit on your own account. Runs live online, in the classroom in Colombo or privately for a development team, priced in LKR for Sri Lanka and USD internationally.