Lesson 16: Costs, Speed and Choosing the Right Model
So far this course has treated language models as if they were all the same. They are not, and the differences matter enormously in practice. Models differ in size, in speed, in cost, and in what they are good at — and choosing the right one is a practical skill, not a matter of picking the biggest or the newest. A small, fast model that answers in a second can be the right choice where a huge model that takes ten seconds would be unusable, however clever its answers.
The first difference is size. A model's size is usually described by its number of parameters — the weights you met in the last course — and larger models generally know more and reason better. But size comes at a price: larger models cost more to run, answer more slowly, and need more powerful computers. For many jobs — sorting feedback, answering simple questions, drafting routine text — a smaller model does the job just as well for a fraction of the cost. The right question is not 'which model is best?' but 'which model is good enough for this job?'
What you actually pay for
The second difference is how you pay. Most models are charged by the token: a small amount for each thousand tokens the model reads in, and a larger amount for each thousand it writes out. That has practical consequences. A long prompt costs money on every question, so keeping prompts short and reusing retrieved passages wisely matters. A model that writes long, rambling answers costs more than one that answers concisely — another reason to ask for short, structured output. And a RAG system that retrieves ten long passages for every question costs more than one that retrieves three short ones. Costs are small per question but add up fast when thousands of people use the application every day.
The third difference is speed. A user waiting for an answer will tolerate a second or two, but not twenty. Speed depends on the model's size, on how much text it must read, and on how much it must write. Streaming — showing the answer as it is generated, word by word — makes a slow model feel faster, because the user sees something happening immediately. But streaming does not make the model faster; it only changes how waiting feels. For a real-time application, a fast small model with streaming will usually beat a slow large one.
Running your own model versus using an API
There are two ways to use a language model in an application. The first is through an API: you send text to a company that runs the model, and it sends back the answer. That is simple, fast to start, and gives you access to the largest models — but your data leaves your hands, you pay per token, and you depend on the provider's availability and rules. The second is to run a model yourself, on your own computers, using one of the openly available models. That keeps your data private, costs nothing per question once the computer is paid for, and lets you change the model — but the models you can run yourself are usually smaller, and you are responsible for keeping them running. The choice depends on the job: a school handling children's data may need to keep it private; a small project with no budget may prefer to run its own model; a company needing the strongest answers may accept the API's costs. There is no universally right answer, only the right answer for the data, the budget and the risks in front of you.
So how do you choose? Start with the job: how accurate must the answer be, how fast must it arrive, and how much can each answer cost? Then test two or three models on your own test set — the one from Lesson 13 — and compare them on accuracy, speed and cost together, not on accuracy alone. Often the answer is to use more than one: a small model for the common, easy questions, and a larger one only for the hard cases. That pattern — routing easy work to a cheap model and hard work to a strong one — is how most real applications keep their costs down without giving up quality.
Watch & Learn
One video to watch for this unit, from a trusted educator.
- Why Large Language Models Hallucinate — IBM Technology
IBM's Martin Keen explains the different types of LLM hallucination, why they happen, and practical steps you can take to reduce them — the companion to Lesson 14.
Key Terms
- Parameter
- A weight inside a model; the number of parameters is a rough measure of a model's size and capability.
- Token pricing
- Charging by the token: a rate for each thousand tokens the model reads, and a rate for each thousand it writes.
- Latency
- How long a user waits for an answer; a model that takes twenty seconds feels unusable even if its answers are good.
- Streaming
- Showing the answer as it is generated, word by word, so the user sees progress immediately.
- Routing
- Sending easy questions to a small, cheap model and hard questions to a larger, stronger one.
- Cost per answer
- The total cost of one answer, including the prompt tokens, the retrieved passages and the tokens generated.
Discussion Questions
- A small model answers in one second and a large one in ten seconds, with slightly better answers. Which would you choose for a live chat, and why?
- Why does a long, rambling answer cost more than a short one, even if both answer the question?
- When would it make sense to use two different models in one application, instead of just one?
Practice Questions
- Why is the biggest model not always the right choice?
- What does token pricing mean in practice?
- What is latency, and why does it matter?
- What is streaming, and what does it not do?
- What is routing, and why do real applications use it?
Show answers
- Because larger models cost more, answer more slowly and need more powerful computers. For many jobs a smaller model does just as well for a fraction of the cost.
- You pay for each thousand tokens the model reads and each thousand it writes. Long prompts and long answers cost money on every question, so concise prompts and outputs save money.
- How long a user waits for an answer; users tolerate a second or two, not twenty. A slow model feels unusable even if its answers are good.
- Showing the answer as it is generated, word by word, so the user sees progress immediately. It makes waiting feel shorter, but it does not make the model itself faster.
- Sending easy questions to a small, cheap model and hard ones to a larger, stronger one. It keeps costs down without giving up quality on the questions that need it.