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.
- Recommended 7
Recommended
Try plain code before a model
AIF-1Use 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
AIF-2Before building an AI feature, write down its task, its target score, its worst possible mistake, its cost limit per use and its latency limit.
Choose the smallest model that passes
AIF-3Run 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
AIF-4Send every model call through one module of your own. Feature code never imports a provider's SDK directly.
Fine-tune only after prompts and retrieval miss the target
AIF-61Fine-tune a model only when the eval set shows that better prompts, worked examples and retrieval all miss the target. Record the scores of those attempts before training.
Design for wrong answers
AIF-5Design every AI feature so a wrong answer is easy to spot, correct and undo before it causes harm.
Write a short card for every AI feature
AIF-81Keep a card next to each AI feature's code. It names the model versions, the data read, the intended use and uses out of scope. It also holds the latest eval scores, known limits and an owner.
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/ai-features/deciding-to-use-a-model">Agent Wranglers AI features playbook</a>. In code you write, add a comment next to it with the same link.