Skip to content
Shahid Malla

How to Choose an LLM for Your App: Criteria That Last

Model names change every few months, so choose on criteria that do not: task fit on your own examples, quality against latency and cost per task, context length, tool use, the data terms, and a tested fallback.

· Published · 12 min read · 8 steps

Choose an LLM by testing candidates on twenty to fifty of your own examples, not by reading a ranking. Score task fit first, then weigh quality against latency and cost per task. Check the context window, tool use, and the data and privacy terms. Decide hosted or open weights, and name a fallback model before you ship.

Choosing an LLM means picking the model that clears your quality bar on one task, at the lowest cost and latency you can accept, under terms your data allows. It is a per-task decision rather than a purchase, because one product often runs a cheap model for routing and an expensive one for the hard step. The names change every few months; the criteria below do not.

Every figure and quotation here comes from a vendor page I read on 24 November 2026, linked where it is used. Model families appear as examples of how a criterion applies, and there are no benchmark scores, because those go stale fastest.

Five-step workflow for choosing an LLM: name the task, gather real examples, score three models, read the data terms, then name a fallback model
The order I work in on a build: the task and the test set come before any model name. Source: shahidmalla.com.

What job are you asking the model to do?

Write down one task and one bar you can score, before you look at any model. Anthropic's guide on defining success criteria and building evaluations calls a criterion good when it is specific, measurable, achievable and relevant. Its example of a bad one is "the model should classify sentiments well"; the good version names an F1 score of at least 0.85 on a held-out test set of 10,000 posts.

OpenAI's model selection guide adds four questions that decide how much the choice matters: how often the workflow runs, how fast you need the result, how you will use the output, and how much quality matters. A nightly job you review in the morning and a chat reply a customer waits for are not the same problem.

CriterionWhat to measureHow to settle it
Task fitPass rate on your own examplesRun the test set described below
LatencyTime to first token at your real prompt lengthMeasure it, do not read a spec sheet
CostPrice of one typical requestCount tokens in a real call and multiply
Context lengthThe longest input you will ever send, plus outputCompare with the published window
Tool useValid arguments, called at the right momentPut tool calls in the test set
Data termsTraining use, retention, region, human reviewRead the terms for the tier you will buy
Exit costHours to move the prompt and tools elsewhereTry the swap once, in staging

How do you build a test set from your own examples?

Collect twenty to fifty real inputs, write the answer you would accept for each, and keep the file in the repository next to the prompt. Anthropic's eval design principles are blunt: be task specific, mirror your real task distribution, automate the grading, and "prioritize volume over quality", because more questions with weaker automated grading beat a few hand-graded ones.

The examples that decide the choice are the awkward ones. The same page names the edge cases worth including: irrelevant or nonexistent input, inputs far longer than usual, hostile user input, and cases ambiguous enough that two people would score them differently.

Then run every candidate on the same inputs with the same prompt. OpenAI's guidance is to compare on identical inputs and "keep the lightest setting that meets your quality bar". I score three at most: the cheapest tier that could plausibly work, the middle tier, and the vendor's strongest model, which is there to show the ceiling rather than to be shipped. My guide on what a token is in AI covers counting the tokens this burns.

How do you weigh quality, latency and cost for one task?

Treat them as one budget per task, and note that the cheapest lever usually sits inside the model you already chose. Anthropic's choosing the right model guide says several current models take an effort parameter that trades intelligence against latency and cost, and that "tuning effort is often a better lever than switching models".

For latency, Anthropic's page on reducing latency separates baseline latency from time to first token, and says to engineer a prompt that works before applying any latency trick, so you learn what good looks like first. Streaming changes what the user feels without changing either number.

Cost is where published rates mislead people, because the spread inside one vendor's own lineup is wider than most people expect.

Bar chart of published Claude prices per million tokens, showing input rates from $0.10 to $8 and output rates from $0.50 to $40 across four models
Four models from one vendor, one price page, read 24 November 2026. Source: Anthropic pricing documentation.
ModelInput per MTokOutput per MTokCache hit per MTok
Claude Haiku 5.5, prompts up to 100,000 tokens$0.10$0.50$0.01
Claude Sonnet 5.5$2$10$0.10
Claude Opus 5.5$4$20$0.20
Claude Fable 5.2$8$40$0.20

Rates from the Anthropic pricing page, read 24 November 2026. Two things follow, whichever vendor you read. The top input rate is eighty times the bottom one, so routing easy requests to the small model beats any amount of prompt trimming. And repeated context is cheap if you cache it: a cache hit on Claude Opus 5.5 is listed at $0.20 per million tokens against $4 for fresh input.

How much context and tool use does the task need?

Size the window against the longest input you will ever send, then check the model can call your tools. On 24 November 2026 the four current Claude models are each listed with a 1M token context window and 128K maximum output, and the Gemini models page lists its Gemini 4 models at 1M tokens as well. The window is rarely the binding constraint now; the bill and the wait are.

A long window is not a substitute for retrieval either. Sending a whole knowledge base on every call costs input tokens on every call and delays the first token, where retrieval sends the three passages that matter. My guides on fine-tuning against RAG against prompting and how a RAG chatbot works cover where that line sits.

For tool use the question is not support, since the Claude models overview states that all current models handle tool use, vision and multilingual input. The question is whether the behavior you depend on survives a model change. Anthropic warns that an integration which forces tool use or turns thinking off should read the breaking changes before switching, and that detail is what turns a one-line swap into a day of work. My guide on LLM function calling has the mechanics.

What do the data and privacy terms allow?

Read the terms for the exact tier you will buy, because the free and paid tiers of one product can differ completely. Google's are the clearest published example. Under the Gemini API Additional Terms of Service, effective 23 March 2026, content submitted to the unpaid services is used "to provide, improve, and develop Google products and services and machine learning technologies", human reviewers may read and annotate API input and output, and the terms say in bold: "Do not submit sensitive, confidential, or personal information to the Unpaid Services." On the paid services, the same document says Google does not use prompts or responses to improve its products.

The other two major API vendors publish an easier default. OpenAI's data controls page states that, as of 1 March 2023, API data is not used to train its models unless you opt in, that abuse monitoring logs are kept for up to 30 days by default, and that zero data retention is available to eligible customers subject to approval. Anthropic's Commercial Terms of Service, effective 17 June 2025, say the customer owns its outputs and that "Anthropic may not train models on Customer Content from Services".

Three questions settle this criterion: is my content used for training on this tier, how long is it kept and who may read it, and can I name the processing region. When a client's answer is a contract requirement, it filters the shortlist before testing starts. My guide on whether ChatGPT is safe for business data asks the same of the consumer products.

Hosted API or open weights on your own server?

Hosted is the default. Open weights earn their place when the data cannot leave your hardware. High steady volume is the other argument for buying a GPU, but I test the cheapest hosted tier first, because its monthly bill is the number a GPU has to beat. The diagram holds the four questions I answer before running a test: data residency, volume, how long and tool-heavy one call is, and whether a cheap model already passed.

Decision flow for picking a model tier: data residency first, then volume, then context and tool needs, ending at a cheap model or the top tier
The four questions I answer before testing anything. Source: shahidmalla.com, from my own order of work.
QuestionHosted APIOpen weights you run
Who holds the dataThe vendor, under its published termsYou, on your own machine
What you payPer token, nothing when idleThe machine, busy or idle
Who carries uptimeThe vendorYou, including the GPU and drivers
Who decides when the model changesThe vendor, on a published retirement dateYou; downloaded weights stay as they are
Legal homeworkTerms of service and a data processing addendumThe model license, not always an open-source one

That last row catches people out, because "open weights" describes a download rather than a license. The Llama 4 Community License Agreement, effective 5 April 2025, grants broad use and redistribution rights with conditions attached: a "Built with Llama" notice on a related website or product documentation, a name beginning with "Llama" for any model you train on Llama outputs, and a separate license request to Meta from any licensee whose products had more than 700 million monthly active users in the preceding calendar month on the release date. Other open-weight models ship under plain open-source terms with none of that, so open the license file before you plan around a model.

If self-hosting is the answer, the binding constraint is memory. My guides on how much RAM an LLM needs and self-hosting an LLM on a VPS have the arithmetic.

How do you avoid lock-in and keep a fallback model?

Assume the model you pick will be retired, and build so that replacing it is an afternoon rather than a project. OpenAI's deprecations page, read on 24 November 2026, says software relying on its models "may need occasional updates to keep working", and lists gpt-5 with a notice date of 11 June 2026 and a shutdown date of 11 December 2026. Anthropic publishes the same fact as a commitment in its models overview: Claude Opus 5.5 retires no sooner than 22 September 2027.

The checks I run before a model choice goes into production:

  • The model id is pinned in configuration, in one place, not spread through the code.
  • A dated snapshot id is used where the vendor offers one, so a floating alias cannot change behavior overnight.
  • The prompt, tool definitions and output parser sit behind one interface, so a second provider is an adapter rather than a rewrite.
  • A model from a second vendor has been scored on the same test set at least once, and the score is written down.
  • Structured output is validated on arrival, so a model swap fails loudly instead of quietly.
  • The retirement date is in the calendar, and token usage and latency are logged per request.

The test set is what makes all of this cheap. Without one, changing models is a matter of opinion and nobody wants to go first.

What do these criteria not tell you?

They rank candidates for one task on one day, and that is all. Four limits are worth stating plainly.

A test set of thirty examples catches gross failures, not rare ones. Where a wrong answer is expensive, the eval is a filter and human review is still the control, which my guide on reducing AI hallucinations covers.

Per-token prices are not always comparable, even inside one vendor. Anthropic's pricing page notes that its 4.7 and later models use a newer tokenizer producing roughly 30 percent more tokens for the same text, so a lower rate can still mean a higher bill.

Prompts are not portable. A prompt tuned against one model usually needs rework on another, so "switching any time" is only true once somebody has tried it.

Published benchmarks measure somebody else's task. Anthropic's own advice on changing models starts with "create benchmark tests specific to your use case" and calls a good evaluation set the most important step in the process.

What else do people ask about choosing an LLM?

How do you choose an LLM for RAG?

Score candidates on grounding rather than general ability: give each the same retrieved passages, then check the answer uses them, cites them, and declines when the passages do not hold the answer. Instruction following and a steady citation format matter more here than raw reasoning, so a mid-tier model often wins on cost.

Does a bigger model always give better answers?

No. Size helps on open-ended reasoning and hurts on latency and cost, and plenty of production work is classification, extraction or routing where a small model matches a large one. Anthropic's choosing a model guide sets out two starting points, and one of them is efficiency first: start with the fastest model, test it, and upgrade only for a specific capability gap.

How do you choose a local LLM model?

Start from the memory you have, not the model you want. The quantized file plus the context cache has to fit in one memory pool, and the license has to permit your use. After those two filters, run the same test set you would run against a hosted API.

How many examples do you need to test a model?

Twenty to fifty labeled examples separate three candidates on a narrow task, and more is better once the grading is automated. Anthropic's eval guidance prefers volume with automated grading over a small hand-graded set. Keep a held-out slice you never use while tuning the prompt.

Should one app use more than one model?

Often, yes. A cheap model can classify, route and draft while an expensive one handles the step that needs judgment, which keeps most tokens on the lower rate. Anthropic documents this as a multimodel strategy, with an executor that escalates to a stronger advisor or an orchestrator that delegates bulk work.

How often should you revisit the model choice?

Whenever the vendor ships a new model in the line you use, whenever the prompt changes materially, and whenever a retirement date appears. Re-running an existing eval set takes minutes, which is the whole argument for writing one.

If you would rather have this decided and built on your data than argued about, I take it as AI integration work, or you can hire me as an AI developer by the hour, with a free scoping call of about 30 minutes and a written quote within one business day.

Last reviewed 24 November 2026. Disclosure: I sell AI development work, so I am not neutral. I build AI agents and chatbots for WHMCS, WordPress, SEO and servers. I am CTO at ElySpace, a freelance developer for Marmaids LLC, and founder of WHMCSPilot and MagizAI, an AI chat product of my own. Every price, quotation and date above comes from the vendor pages linked in the text, read on 24 November 2026.

Share this article

Shahid Malla

Written by

Shahid Malla

Freelance WHMCS developer and web designer with 13+ years of client work. CTO at ElySpace, freelance developer for Marmaids LLC, and founder of WHMCSPilot and MagizAI.

Got a project like this?

Tell me what you need and I will send a written quote within one business day.