Structured Outputs and Prompts as Code
Free text is great for humans but terrible for code. In this post I show how I get reliable JSON from LLMs with schemas and validation, and why I treat prompts like code: versioned, reviewed and tested.
Posts tagged “ai”.
Free text is great for humans but terrible for code. In this post I show how I get reliable JSON from LLMs with schemas and validation, and why I treat prompts like code: versioned, reviewed and tested.
Calling an LLM API is easy. Running it in production is not. These are the backend patterns I use to make AI features reliable, cheap and safe: timeouts, retries, queues, caching and good boundaries.
Every post on this blog has a small chat. You ask a question and the AI answers using the article. In this post I explain how it works: chunks, embeddings, vector search and a good prompt. This technique is called RAG.
Unit tests expect the same output every time. LLMs don't work like that. Evals are the answer: a set of examples, a way to score the results, and a number you can compare. Here is how I build them.
Scout checks your app's metrics every 20 minutes. When something goes wrong, it finds the broken part of the code and asks an AI model to explain the problem — and how to fix it.
AI assistants write code very fast. But the code goes to production with my name on the pull request. This is the checklist I use to review AI-generated code, and the mistakes I see again and again.