The model landscape: hosted vs open-weight
Compare models on quality, latency, cost, context size and licensing for a use case.
By Invicly Tech, , in AI Engineering with Python. About 12 minutes to read.
In short
You can call hosted models through a provider's API or run open-weight models on your own hardware. The right choice depends on quality, latency, cost, context size, privacy and licence for your use case.
Explained simply
There are two main ways to use a language model. You can call a hosted model over the internet and pay for each request, or you can download an open-weight model and run it on your own computer or servers. Both are normal choices in real products.
Hosted models are run by a company. You send text and get text back, and you never see the model itself. You do not manage any hardware, and the top hosted models are often the strongest. The trade-off is that your data travels to the provider and you pay per token.
Open-weight models are models whose trained numbers (the weights) you can download. You decide where they run, so data can stay inside your network. But you pay for the hardware, you keep it running, and you must read the licence, which says how you are allowed to use the model.
No model is best at everything. The right choice is the smallest, cheapest model that does your task well enough, fast enough, within your privacy rules. You find it by testing a few candidates on your own examples, not by reading a leaderboard.
Press Play on a diagram to walk through it one step at a time.
- Often strongest quality
- No GPUs to manage
- Pay per token
- Data leaves your network
- Download and run yourself
- Full control and privacy
- You pay for hardware and ops
- Check the licence terms
- 1Write constraints
Quality bar, latency, budget, privacy
- 2Shortlist 3 or 4
Mix large, small, hosted and open
- 3Run your eval set
Same prompt and scoring for each
- 4Measure speed and cost
TTFT, tokens per second, cost per call
- 5Check terms
Context size, data terms, licence
- 6Pick the smallest pass
Re-test when versions change
In depth
Ways to get a model, from least to most work
There are more than two options in practice. The simplest is a provider's own API with its official SDK. Large cloud platforms also offer model catalogues, so you can call well-known models through your existing cloud account, with your cloud's billing, regions and access controls. Inference providers host popular open-weight models behind an API, so you get open models without running GPUs.
At the other end you run the model yourself. On a laptop or a single machine, tools like Ollama and llama.cpp make this easy. On GPU servers that must serve many users, engines such as vLLM batch requests together to use the hardware efficiently.
Many teams mix these: a hosted model for hard tasks, a small self-hosted model for cheap, private or offline work. Hiding the model behind one small interface in your code makes switching cheap.
- Provider API
- Official SDK
- Pay per token
- Newest models first
- Cloud model catalogue
- Your cloud account and billing
- Pick a region for data
- Open-weight via inference host
- Open models, no GPUs to run
- Pay per token or per hour
- Self-hosted
- Laptop: Ollama, llama.cpp
- Servers: vLLM on GPUs
- You run and patch it
What open-weight really means, and what hardware it needs
Open-weight means the weights are published. It does not always mean open source: the training data and training code are often not released, and the licence may add rules. Model size is given in parameters, such as 8B (8 billion) or 70B.
A quick memory estimate is parameters times bytes per parameter. At 16-bit precision each parameter takes 2 bytes, so an 8B model needs about 16 GB just for its weights. Quantisation stores weights with fewer bits: at 4 bits the same model needs roughly 4 to 5 GB, which fits on many laptops, with a small loss in quality.
On top of the weights you need memory for the KV cache, which grows with context length and with the number of users served at once. A 70B model at 16 bits needs about 140 GB for weights alone, so it needs several data-centre GPUs or heavy quantisation.
- Weights memory = parameters x bytes per parameter
- 16-bit: 2 bytes; 8-bit: 1 byte; 4-bit: about half a byte
- Longer contexts and more users need more memory
Judging quality fairly
Public benchmarks test general skills such as maths, coding or knowledge. They are useful for a first shortlist, but they have limits. Some test questions leak into training data, which inflates scores. Leaderboards that rank by human preference reward a pleasant style, which may not matter for your task.
The reliable method is your own eval set: 30 to 100 real examples from your use case with the answers you expect, including hard and odd cases. Run every candidate model with the same prompt and score the results the same way. Often a small model scores almost as well as a large one on a narrow task, such as classifying tickets or extracting fields.
Re-run the eval when a provider releases a new model version. Behaviour can change between versions even when the name looks similar, so pin an exact model version in production where your provider allows it.
Latency and cost: the numbers to compare
Two latency numbers matter. Time to first token (TTFT) is how long until the reply starts. Output speed is how many tokens per second arrive after that. Total time is roughly TTFT plus output tokens divided by speed: 500 output tokens at 50 tokens per second take about 10 seconds plus TTFT. Smaller models are usually faster at both.
Hosted cost is input tokens times the input price plus output tokens times the output price, and output is usually several times more expensive. Some models first produce hidden reasoning tokens that are billed as output, so check usage numbers, not just the visible text.
Self-hosting costs a fixed amount per GPU-hour whether it is busy or idle. It only beats per-token prices when the hardware stays busy most of the time, and you must add the cost of the engineers who run it.
Context size, data terms and licences
Check the context window and the maximum output length for each candidate, and test long inputs yourself, because quality on very long prompts varies. Then read the data terms: does the provider keep your prompts, for how long, can they use them for training, and in which regions is data processed? For personal, medical or financial data these answers can decide the choice on their own.
Open-weight licences differ a lot. Some models use permissive licences such as Apache 2.0 or MIT. Others use custom licences that add acceptable-use rules, require attribution, or need a separate agreement for very large companies. Some restrict commercial use entirely. Read the actual licence file for the exact model version, and check whether outputs may be used to train other models.
- Context window and max output tokens
- Data retention and training use of your prompts
- Processing region and compliance needs
- Licence: commercial use, attribution, size limits
Learn it in 3 short steps
About 40m each. Track them with a timer in your plan.
- 1Compare hosted and open-weight models~40m
- 2Compare quality, latency and cost~40m
- 3Check context size and licensing~40m
Key points
- Pick the smallest model that passes your evals; bigger is slower and costlier.
- Compare models on your own task data, not just public leaderboards.
- Check context size, rate limits and data retention terms before committing.
- Open-weight licences vary; some restrict commercial use or large deployments.
Key terms
Tap a card to flip it. 0/5 known
Examples
Large or small model for a ticket classifier
A support team gets 50,000 tickets a day and wants each one tagged with one of 8 categories. Each call sends about 400 input tokens and gets about 10 output tokens back. Step 1: run both candidate models on 200 labelled tickets. Say the large model scores 97% and the small one 96%. Step 2: price both with the provider's current prices. The code uses made-up example prices. Step 3: the large model costs about 67 dollars a day and the small one about 6, for one point of accuracy. Step 4: pick the small model, and send only low-confidence tickets to the large one.
# Example prices in dollars per million tokens (check your provider)
MODELS = {"large": (3.00, 15.00), "small": (0.25, 1.25)}
CALLS_PER_DAY, TOKENS_IN, TOKENS_OUT = 50_000, 400, 10
for name, (price_in, price_out) in MODELS.items():
per_call = TOKENS_IN / 1e6 * price_in + TOKENS_OUT / 1e6 * price_out
print(f"{name}: ${per_call * CALLS_PER_DAY:.2f} per day")
# large: $67.50 per day
# small: $5.63 per dayPatient notes must stay on site
A clinic wants to summarise doctors' notes, but its rules say patient data cannot leave its network. Step 1: this rules out hosted APIs unless a contract and region meet the rules, so the team looks at open-weight models. Step 2: estimate memory. An 8B model at 4-bit quantisation needs about 4 to 5 GB for weights, so one modest GPU is enough. Step 3: read the licence to confirm medical and commercial use is allowed. Step 4: run the eval set of 50 real, anonymised notes and compare against a larger model to see the quality gap.
def weights_gb(params_billion: float, bits: int) -> float:
bytes_per_param = bits / 8
return params_billion * bytes_per_param # 1e9 params x bytes = GB
for bits in (16, 8, 4):
print(f"8B model at {bits}-bit: ~{weights_gb(8, bits):.0f} GB")
# 16-bit: ~16 GB, 8-bit: ~8 GB, 4-bit: ~4 GB (plus KV cache)Quick reference
- Pick the smallest model that passes your own eval set
- Weights memory is about parameters x bytes: 8B at 16-bit is about 16 GB
- 4-bit quantisation cuts weight memory to about a quarter of 16-bit
- Total latency is about TTFT + output tokens / tokens per second
- Output tokens usually cost several times more than input tokens
- Open-weight is not always open source: read the licence for each version
- Pin an exact model version in production and re-run evals before upgrading
Common mistakes
- Choosing a model from a leaderboard without testing it on your task.
- Ignoring data privacy requirements when sending user data to an API.
Quick quiz
Pick an answer to see if you're right and why.
Practice exercises
Try each one yourself first. Use the hint if you get stuck, then compare with the solution.
- Exercise 1easy
Pick one open-weight model you have heard of. Find its licence and answer: can you use it commercially, must you credit it, and are there any user or company size limits?
- Exercise 2medium
Write a cost table for three candidate models for a summariser that receives 2,000 input tokens and returns 300 output tokens, at 5,000 calls per day. Use the providers' current price pages.
- Exercise 3hard
Run a mini model bake-off: 30 examples of a real task, two hosted models and one local model. Record accuracy, median latency and cost per 1,000 calls, then write a one-paragraph recommendation.
Check yourself
Answer in your head, reveal, then be honest with yourself.
Feel confident about this topic?
Frequently asked questions
- Is an open-weight model the same as open source?
- Not always. Open-weight means you can download the weights; training data and code may stay private, and the licence may restrict how you use the model.
- Can I run a useful model on my laptop?
- Yes. Small models of a few billion parameters, quantised to 4 bits, run on many laptops with tools like Ollama or llama.cpp. They are slower and weaker than top hosted models but fine for many simple tasks.
- Do hosted providers train on my API data?
- It depends on the provider and your plan. Read the data usage and retention terms before sending user data, and look for business or zero-retention options if you need them.
- Should I always use the newest model?
- No. Newer models can behave differently, so run your evals first and switch only if quality, speed or cost improves for your task.