How to Choose an LLM — Decision Tree for Builders
With 100+ models available, choosing the right LLM is genuinely complex. This decision tree walks through: task type, quality requirements, cost sensitivity, context needs, and compliance constraints.
Step 1: What is the task type?
Simple classification / extraction / formatting → GPT-5 mini or Gemini 2.5 Flash ($0.25/M). Standard Q&A / summarization / coding → Claude Sonnet 5 or GPT-5.4 ($2.50–3.00/M). Complex reasoning / analysis / research → Claude Opus 5 or GPT-5.4 ($10–15/M). Math / code competitions → DeepSeek R1 or OpenAI o3.
Step 2: Context window requirements
<32K tokens: any model. 32K–128K: Claude Sonnet/Opus, GPT-5.4, Gemini Flash. 128K–1M: Gemini 2.5 Pro/Flash. >1M: Gemini with extended context. Llama 4 Scout for experimental 10M (not production-ready).
Step 3: Data sovereignty / compliance
US data residency required: OpenAI, Anthropic, Google (all US-based infra options). No third-party data processing: self-host Llama 4, Qwen, or Mistral. EU GDPR with EU data residency: Google Gemini (EU regions), Mistral (Paris-based), or self-hosted. Financial / HIPAA workloads: OpenAI Enterprise or Anthropic Enterprise (BAA available).
Step 4: Cost sensitivity
Cost is the top priority: Gemini 2.5 Flash ($0.075/M) or DeepSeek V3 ($0.27/M). Cost matters but so does reliability: GPT-5 mini ($0.25/M) or Claude Haiku 4.5 ($0.80/M). Quality is the priority: Claude Opus 5 ($15/M) or GPT-5.4 ($2.50/M). Start here and work backward from quality requirements.
Related calculators
Related guides
Frequently Asked Questions
Should I build with the best model or the cheapest?
Start with the cheapest model that meets your minimum quality bar (run evals). Only upgrade when eval data proves the cheaper model fails at rates that matter. 80% of production tasks don't require a flagship model.
Should I use OpenAI or Anthropic?
This is the wrong question — they serve different strengths. OpenAI (GPT-5.4) for strict structured output, OpenAI ecosystem integrations, and coding. Anthropic (Claude Sonnet 5) for long documents, writing, and nuanced instruction following. Use the model that performs best on your specific task eval.
Guide updated 2026-08-20. Pricing data verified weekly. See methodology · sources.