All lessons · 44
Path 3 · AI Engineer Roadmap·Lesson 4 of 33

Types of AI Models

Pre-trained models, closed vs open weights, self-hosting. Who makes them — OpenAI, Anthropic, Google, Meta, Mistral, DeepSeek — and how to pick a lane.

LevelBeginnerTime~12 min

One engine, many brands

In the previous article we saw that an AI Engineer uses pre-trained models instead of training them. But “pre-trained models” is not one thing. There are several families, several providers, and very different trade-offs between them. This article is the map.

Why should you care, if you just want to ship something? Because this choice decides three very concrete things: what you pay, where your users’ data ends up, and how much server work lands on your plate. Get it wrong and you either burn money or spend your weekend babysitting servers.

The good news: almost every modern LLM works the same way from your side of the table. You send text in, you get text out. What differs is who owns the model, where it runs, and what it costs.

Closed models: the big labs

These are models you access through an API — a doorway on someone else’s server: you send text in, an answer comes back, like ordering food instead of cooking. You never get the weights, the huge file of numbers that is the model (that file is the result of training). You just rent intelligence by the token: a small chunk of text, roughly 3-4 characters, and the unit you are billed in.

  • OpenAI — the GPT family (GPT-4o, GPT-4.1, o-series reasoning models). The de facto default for many products, huge ecosystem, wide multimodal support.
  • Anthropic — the Claude family (Haiku, Sonnet, Opus). Known for long context, careful output style, and strong coding performance.
  • Google — Gemini. Enormous context windows, tight integration with the Google cloud ecosystem, good multimodal support.

Closed models today are the quality leaders. If you want the best possible output with the least effort, this is where you start.

The trade-offs: your data goes to someone else’s servers, you depend on their pricing and rate limits (a cap on how many requests you may send per minute), and if the provider deprecates a model you rely on — retires it — you have to migrate your code to a newer one.

Open-weight models: the alternatives

Here the weights are published, so you can download the model and run it yourself — that is self-hosting: the model runs on a machine you control, not on the provider’s — or rent a machine from a hosting service and run it there.

  • Meta — Llama. The most popular open-weight family; a huge ecosystem of fine-tunes and tooling grew around it.
  • Mistral — French lab with efficient open models and a permissive approach; strong small models that punch above their weight.
  • DeepSeek — Chinese lab that shocked the industry with reasoning models trained at a fraction of the usual cost, released with open weights.

“Open” does not always mean fully open source — licenses vary (some allow commercial use, some restrict it). But in practice: you can run these models on your own hardware.

Names age fast

Model families and exact versions change every few months — treat every name in this article as an example, not a recommendation. The categories are stable (flagship tier, cheap workhorse tier, open weights); which model sits in each tier is a “check current options” question at the moment you choose.

The honest trade-off table

Closed API Open weights
Quality best available close, a step behind the frontier
Cost pay per token, no upfront hardware or rented GPU time
Privacy data leaves your machine full control, can run air-gapped
Control provider decides limits, deprecations you decide everything
Ops burden zero real — GPUs, updates, scaling
Speed to market minutes days or weeks

Two words in that table worth unpacking:

  • GPU — the expensive chip these models actually run on. Renting one by the hour is the main cost of self-hosting.
  • Air-gapped — the machine is physically disconnected from the internet. Maximum privacy, maximum inconvenience.

Ops burden is the row beginners underestimate: someone has to install drivers, apply updates, restart crashed servers at 3am and add capacity when traffic spikes. With an API, that is the provider’s problem.

A note on cost: closed APIs are pay-per-token — on the order of tens of cents per million input tokens for workhorse models, and several dollars or more for frontier ones (ballpark figures; prices move, so check current ones before you commit). That sounds cheap until your product serves thousands of users around the clock. At small scale, APIs almost always win. At very large scale with predictable load, self-hosting can win — sometimes dramatically.

When self-hosting actually makes sense

Self-hosting an open model is not a moral stance; it is an engineering decision. It makes sense when:

  • Privacy is non-negotiable — medical, legal, or internal corporate data that legally cannot leave your infrastructure.
  • Volume is huge and predictable — millions of requests per day of a narrow task where a smaller model suffices.
  • You need full control — custom fine-tunes, guaranteed latency, no third-party dependency in your critical path.
  • Edge or offline — the product must work with no internet at all.

Otherwise, start with an API. You can always migrate later — and thanks to a nice quirk of the industry (see the article on APIs and SDKs), switching providers is often less painful than you would expect.

Try it: the same task, different providers

Even if you never write a line of code, the next bit is worth skimming, because it explains something practical: switching between providers is mostly a one-line change. That is why nobody is really locked in.

The two tabs below are the same program. The only difference is the address it sends the request to: base_url is the internet address of the model server, and model is the name of the model you want. The second tab talks to a program like Ollama or vLLM — an inference server: a small app that runs a downloaded model on your machine and answers requests just like a hosted API.

switch providers
1from openai import OpenAI
2 
3client = OpenAI(
4 api_key=#98c379">"YOUR_KEY",
5 base_url=#98c379">"https://api.openai.com/v1",
6)
7 
8response = client.chat.completions.create(
9 model=#98c379">"gpt-4o-mini",
10 messages=[
11 {#98c379">"role": "user", "content": "Explain RAG in one sentence."}
12 ],
13)
14 
15print(response.choices[0].message.content)

Notice what happened: the only line that changed is the base URL and model name. That is deliberate, and it is the backbone of the whole ecosystem — we will dig into it in the article on APIs and SDKs.

No code? Ask the model itself

You do not have to decide any of this alone. Paste this into ChatGPT, Claude or any assistant and fill in the four blanks about your project honestly:

Copy this prompt — closed vs self-hosted for your case
I am choosing between a closed API model (like GPT or Claude)
and a self-hosted open-weight model (like Llama or Mistral).

My project: [one sentence — what it does]
My data: [e.g. "public text" / "customer emails" / "medical records"]
My volume: [e.g. "100 requests a day" / "2 million a month"]
My team: [e.g. "one developer, no devops" / "a platform team"]

Answer in this order:
1. Which option fits me, and in one sentence why.
2. The strongest argument AGAINST that choice.
3. One concrete thing I should verify before committing.
Keep the whole answer under 150 words. No code.

Read the answer skeptically

An assistant will happily invent prices and model names that sounded right when it was trained. Treat its answer as a checklist of things to check yourself — not as a verdict.

Check yourself

Check yourself

You run a closed API model. What does "you never download the weights" mean in practice?

Which situation is the strongest case for self-hosting?

What is the hidden cost of open-weight models that the table calls "ops burden"?