Back to notes
Apply this to a build
Model selectionGuide6 min
Choose an OpenAI model for an AI SaaS workflow
A practical selection framework for balancing quality, latency, cost, and tool-use requirements.
Open source docReal workflow example
An AI SaaS product extracts invoice fields and also evaluates unusual payment disputes. One task is repetitive; the other requires reasoning over context.
Use a faster, cheaper model for structured extraction that is heavily validated by schema. Use a stronger model for dispute analysis where it must compare evidence and explain uncertainty.
The workflow controls cost without forcing every step onto the largest model.
Implementation approach
This guide is anchored in OpenAI models guide. Use the official API behavior as the boundary, then design the surrounding product state so the feature can be reviewed, retried, and improved.
- Classify the task as extraction, classification, drafting, reasoning, tool orchestration, or voice.
- Measure acceptable latency and cost for the user-facing moment.
- Run representative examples against candidate models with the same schema and tools.
- Choose the cheapest model that passes quality and safety requirements.
- Keep model choice configurable for future testing.
Code or config snippet when useful
type choose_openai_model_ai_saas_workflow_workflow_state = {
sourceId: string;
status: "draft" | "needs_review" | "approved" | "blocked";
evidence: Array<{ source: string; summary: string }>;
nextAction: string;
};
Field notes
- Model choice should be tied to workflow risk, not hype.
- Use smaller or faster models where the task is bounded and validated by code.
- Use stronger reasoning where the model must compare evidence, plan, or handle ambiguity.
Mistakes to avoid
- Do not choose a model based only on benchmark headlines.
- Do not use the same model for every task by default.
- Do not ignore latency at user-facing moments.
Ready checklist
- Task category defined
- Latency budget known
- Cost budget estimated
- Representative evals run
- Model is configurable
