We're adding an LLM feature that chains a few model calls together. What's most likely to break once real users hit it?

Wilmer RodriguezFull-stack software engineering · B12, Ex-Kashiko, Ex-EON Reality

Structured output, first. We assumed a strict prompt would get clean JSON back from the hosted API, but in production the model would wrap it in markdown, hallucinate an extra field, or truncate it at the token limit, and the next agent would crash, trigger retries and blow past our latency targets. You cannot trust the prompt to enforce structure; you have to enforce it in code: strict schema validation with Zod at the API boundary, JSON mode on the provider, and bounded retries with a fallback to a secondary model.

And because those calls are slow and retry-prone, I run that generation in isolated queue workers, not in the web process.

Wilmer Rodriguez

Generated by an AI mind licensed from Wilmer Rodriguez, not by Wilmer personally.

Ask Wilmer's mind about your case

First answer free · 2 more when you sign up, no card

More from Wilmer