QuiddityML

By · 13 November 2026 · 5 min read

Open-weight vs closed LLMs

How the two compare on data handling, setup, cost and updates, and a simple way to pick one for a project with private data or a short deadline.

An open-weight model is a model whose weight files you can download and run on your own hardware. A closed model is one you reach only through a provider's app or API, where the provider runs the model and sends you the result. Projects that build on a large language model usually start by picking one of the two.

Three ways to get a working model

Most projects that use a transformer do not train one from random weights, because that takes a large dataset and a lot of compute. There are three practical paths instead:

These are three separate choices, not three stages of one pipeline. The second and third both start from a model someone else already trained.

Three separate paths under one question, what do you need to control? Build a small model yourself: you write the layers of a small transformer and run the forward pass, loss, backward pass and optimizer step. Load open weights: you get the weights, the tokenizer, the config and the model card. Call a closed API: your application sends a request to a hosted model whose weights are not available.

What open weights means

A model is a large set of numbers, its weights, stored in files. An open-weight model lets you download those files together with three others. The tokenizer files hold the rules that split text into tokens and map each token to an id the model reads. The config file lists the model's sizes, such as how many layers it has. The model card is a page that describes what the model was trained for and what its license allows.

With those files on disk you can run the model on a laptop, a rented GPU or your own server. Depending on the license, you may also be allowed to modify the model, adapt it to a new task or ship it inside a product.

Language models built from transformers come in three shapes. Decoder-only models generate text one token at a time. Encoder-only models turn text into vectors for tasks such as classification, and encoder-decoder models read one text and write another, as in translation. Downloadable decoder-only families include Llama, Mistral and Qwen, and Gemma and Falcon are two more. BERT, RoBERTa and DeBERTa are downloadable encoder-only models, and T5 and BART are encoder-decoder ones.

Open weights still come with rules. Licenses differ between these families and some carry use restrictions, so read the license on the model's page instead of assuming it.

Looking at open weights in code

Hugging Face's transformers library downloads a model's files from the Hugging Face Hub, a website that hosts model repositories. GPT-2 is a small open-weight decoder-only model, and once it is loaded its weights are ordinary PyTorch tensors:

1from transformers import AutoModelForCausalLM
2 
3model = AutoModelForCausalLM.from_pretrained("gpt2")
4 
5print(sum(p.numel() for p in model.parameters()))  # 124439808
6print(model.transformer.wte.weight.shape)          # torch.Size([50257, 768])
7print(len(model.transformer.h))                     # 12

The model has 124,439,808 weights. wte is its token embedding table, with one row of 768 numbers for each of the 50,257 token ids in its vocabulary, and h holds its 12 transformer blocks. You can read, change or save any of these numbers, which a closed model does not let you do.

Open weights. A model repo holds four files: weights, tokenizer files, config, and a model card tagged check license. Arrows run from the repo to three places the model can go: a laptop, a GPU server, and adapt later if license allows.

What a closed model means

A closed model is used through a product or an API. ChatGPT, Claude and hosted model APIs are examples. Your code sends input text over the network and the provider runs the model on its own hardware. You get back text or structured output such as JSON. The weights are not downloaded into your project. The provider handles serving, hardware, scaling and updates.

Closed model API. Your app sends a request to a closed model and gets a response back. Inside the closed model, the layers sit behind a red cover labeled weights not downloaded. Below it, the provider runs hardware and the provider controls updates.

In Python, a call to a hosted model is usually one function call such as client.responses.create(model="some-hosted-model", input="Classify: the cute axolotl is calm"), where client is the provider's API client. You send text or structured messages and get output back. You usually do not receive the tokenizer, the hidden states, the logits (the raw score the model gives each possible next token) or any weight files.

Closed API call shape. The call client.responses.create(...) sends the request text Classify: the cute axolotl is calm to a hosted model. Inside the hosted model, the tokenizer, tensors and weights are each locked. The model returns text or structured output. Notes at the bottom: no local weights, limited internals.

That makes a closed API easier to start with. The cost is that you see less of what happens inside the model and control less of it.

The tradeoffs

Open weights usually give more control. You choose the hardware, inspect the files, pin one exact version and keep data inside your own environment if you run the model there. You also take on serving, monitoring, upgrades and the hardware bill.

Closed APIs cut setup. The provider runs the model and may offer hosted models larger than what you could run yourself. In exchange, every request leaves your app over the network and you pay per use. The provider can also update the model on its own schedule.

Open weights vs closed API, row by row. Control: you run the weights, or the provider runs the model. Data path: can stay in your environment, or the request leaves your app. Setup: you serve it, or there is no model server to run. Latency: depends on your hardware, or a network round trip. Cost: hardware plus engineering time, or billed per use. Updates: you pin the version, or the provider may update. Neither column is automatically better, the constraint decides.

How to choose

A reasonable first question is what you need to control. Open weights usually fit when you need:

A closed API usually fits when you need:

For example, a team that has to keep private support tickets on its own servers would lean toward open weights, since a closed API sends each ticket to the provider. A two-person team testing an idea for a week would lean toward a closed API, since nothing has to be set up.

Neither choice is better in general. The deciding factors for a given project are data sensitivity and latency, plus budget, team skills and the license.

Choose by constraints. Start from what do you need to control? If you need local data or fixed weights, the answer is open weights, which brings hardware, license and monitoring to handle. If you need fast setup or managed serving, the answer is a closed API, which brings network, usage cost and provider updates to handle.

Common mistakes

How to load a model with Hugging Face transformers shows the code side of open weights: the Auto classes, the tokenizer that has to match and how to generate text. Fine-tuning vs transfer learning explained covers what you can do once you have the weights, which is keep training them on your own data. Encoder vs decoder vs encoder-decoder explains the three model shapes that the families above belong to.

QuiddityML teaches open and closed models as their own concept in the Intro to NLP track, right before loading models with Hugging Face. The multiple choice questions on it include picking the right path for a team that has to keep its support tickets on its own servers.