# Model weights

> Canonical: https://skillalmanac.com/glossary/model-weights | Last verified: 2026-11-25 | Index status: index-eligible

Model weights are the numbers inside a trained AI model that store what it learned. Training adjusts them to reduce errors, and they are saved as files that a program loads to run the model.

Also called: weights in neural network, AI weights, neural network weights, model weight files.

## In plain language

Model weights are the long list of numbers a model has learned from its training. Each one is like a dial that makes some connection inside the model stronger or weaker; training turns the dials until the model's answers improve. The weights are the model in a practical sense: they are the files you download or load to run it. A company that publishes them lets others run the model on their own machines, which is the idea behind an open-weights model. Check checkpoint storage and the runtime's host/device memory needs separately. A runtime may keep weights resident or offload layers through CPU memory and disk, so the whole checkpoint need not fit in device memory at once.

## Technical definition

In a neural network each connection carries weights, the numbers, alongside bias terms, that the network adjusts during training (IBM). Backpropagation computes loss gradients; the optimizer applies parameter updates. PyTorch's tutorial separates loss.backward() from optimizer.step(). After training, the weights are saved to files; Hugging Face's safetensors format stores them as tensors. The Hugging Face safetensors format is described as a simple format for storing tensors safely, as opposed to pickle, that is still fast, and the Transformers library implements methods for loading and saving a model from a local file or directory or from the Hugging Face Hub.

## How it shows up when you use agents

When you use a hosted agent such as Claude Code, you pick a model by name with `/model` and do not handle weight files yourself. The weights come into view when you run a model yourself. An [open-weights model](/glossary/open-weights-model) is one whose weights are published, so you download the files and load them with a runtime on your own machine for [inference](/glossary/inference).

What breaks when weights are misunderstood. People assume that having the weights means they can inspect the training data or reproduce the model. A weights release gives you the numbers, and the training data and code may stay private. Another failure is downloading weights that do not fit in memory. See [Quantization](/glossary/quantization) for reduced-precision copies.

Next action: before downloading, check the licence and use the [local model sizing](/skills/skill-almanac/local-model-sizing) skill to see whether the files fit. The safetensors documentation describes its format as one for storing tensors safely, as opposed to pickle.

## Common confusions

- **Weights versus the model.** The architecture describes how the network is laid out. The weights are the learned numbers that fill it. You need both to run a model.
- **Weights versus training data.** Weights are the result of training on data. Having them does not give you the data itself.
- **Weights versus a hosted API.** With an API the provider holds the weights. With open weights you hold the files.
- **Weights versus fine-tuning.** [Fine-tuning](/glossary/fine-tuning) changes weights, or adds adapter weights, starting from an existing model.

## Worked examples in this catalogue

### [local-model-sizing](https://skillalmanac.com/skills/skill-almanac/local-model-sizing)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A calculation of whether an open-weight language model will run on a given GPU, Mac or PC, with a script that computes weight, KV-cache and overhead memory per quantization.

Why it exercises the concept: Hypothetical preparation: supply a checkpoint size, precision and hardware budget to estimate resident-weight, KV-cache and overhead memory. This sizing estimate does not model every CPU/disk offload runtime or prove that inference will fit; check those runtime requirements separately.

### [hf-cli](https://skillalmanac.com/skills/huggingface/hf-cli)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A command-line tool for the Hugging Face Hub (the catalogue carries no description of its own).

Why it exercises the concept: Weights are usually distributed as files on a model hub, and this skill is a command-line tool for the Hugging Face Hub, listed without a description in this catalogue.

### [Claude Code](https://skillalmanac.com/tools/claude-code)

```
/model
```

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: Claude Code's commands reference says /model switches the AI model, with no weight files for you to download or manage.

Why it exercises the concept: It is a contrast case: you choose a model whose weights you never hold, unlike a local model where you load the weight files yourself.

## Related terms

- [AI model](https://skillalmanac.com/glossary/ai-model.md)
- [Neural network](https://skillalmanac.com/glossary/neural-network.md)
- [Open-weights model](https://skillalmanac.com/glossary/open-weights-model.md)
- [Fine-tuning](https://skillalmanac.com/glossary/fine-tuning.md)
- [Inference](https://skillalmanac.com/glossary/inference.md)
- [Quantization](https://skillalmanac.com/glossary/quantization.md)

## Sources

- [What Is an AI Model?](https://www.ibm.com/think/topics/ai-model), IBM (accessed 2026-11-24)
- [Safetensors](https://huggingface.co/docs/safetensors/index), Hugging Face (accessed 2026-11-24)
- [Models](https://huggingface.co/docs/transformers/en/main_classes/model), Hugging Face (accessed 2026-11-24)
- [Optimizing Model Parameters: backward and optimizer steps](https://docs.pytorch.org/tutorials/beginner/basics/optimization_tutorial.html), PyTorch (accessed 2026-11-25)
- [Big Model Inference: layer and disk offloading](https://huggingface.co/docs/accelerate/usage_guides/big_modeling), Hugging Face Accelerate (accessed 2026-11-25)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-25. [Glossary index](https://skillalmanac.com/glossary.md).
