Deciding to use a model
Use a model only where plain code cannot do the job. Write down what success means, pick the smallest model that meets it and plan for wrong answers.
- Required 3
- Recommended 2
Required
Try plain code before a model
RequiredUse a language model only for a task that plain code, a search index or a fixed rule cannot do well enough. Write down why.
Define success before you build
RequiredBefore building an AI feature, write down its task, its target score, its worst possible mistake and its cost limit per use.
Design for wrong answers
RequiredDesign every AI feature so a wrong answer is easy to spot, correct and undo before it causes harm.
Recommended
Choose the smallest model that passes
RecommendedRun the eval set on several models, from small to large, and ship the cheapest and fastest one that meets the spec.
Call models through one module
RecommendedSend every model call through one module of your own. Feature code never imports a provider's SDK directly.
For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers ai features playbook: https://agentwranglers.se/playbook/ai-features/deciding-to-use-a-model.