Building with the AI API
- 1Part 1·4 min read·IntermediateUp next
Your Prompt Worked in Chat. Why Is the LLM API Different?
A chat prompt moved into code goes flat, forgets and fails with 400s. Send the history, write the system prompt, set effort and a schema, and read the stop reason first.
- 2Part 2·4 min read·Intermediate
Build the Agent Loop Yourself, Once
Tool use and the agent loop in eleven lines of Python, the four changes that harden it, and when one loop stops being enough.
- 3Part 3·4 min read·Intermediate
Did Your Prompt Change Help? Prove It with an Eval
A model upgrade can change behaviour with no error. What an eval is, the three graders, the held-out slice, and how evals make upgrades routine.
- 4Part 4·4 min read·Advanced
RAG That Works: Why Retrieval Matters More Than the Prompt
Most bad RAG answers are retrieval problems. How RAG works end to end, the three parts of the grounded prompt, how to measure retrieval alone, and when long context is enough.
- 5Part 5·5 min read·Advanced
Your LLM Demo Works. What Every Call Needs in Production
One timestamp in the system prompt and every call misses the cache. Pricing each call, making failures loud, logging per feature, and treating outside text as untrusted.
- 6Part 6·4 min read·Advanced
Your LLM Proxy Retries the Wrong Errors
What an LLM proxy has to decide on every failure: limits are per organization, which statuses to retry, why nothing is retried after the first streamed byte, and the headroom headers the API already sends.