A pipeline is a contract: input schema, output schema, and a defined behavior when the model breaks the contract.
Use structured outputs and validate them. Treat a validation failure as a normal branch, not an exception that kills the run.
Evaluate on a frozen set. Track quality, cost and latency together; optimizing one in isolation usually regresses another.
Log the prompt, the raw response and the parsed result. When something goes wrong, you will want all three.