Understanding How Ollama Stores Models
AI Summary
Summary: Olama Model Storage and Management
- Common Questions:
- Location of Olama model storage is confusing to users.
- Models are stored in different directories based on the operating system.
- Storage Locations:
- Mac:
~/olama/models
- Linux:
/usr/share/olama/olama/models
- Two main directories:
blobs
andmanifests
- Manifest Directory:
- Organized by
registry/organization/model
.- Currently, a single registry at
ol.
is used.- Official models are under
Library
.- Model Directories:
- Example:
llama 2
model directory contains files for each tag pulled.- Manifest Files:
- Schema version set to two, not related to Olama but to Docker.
- Media type:
application/vnd.docker.distribution-manifest.v1+json
.- Olama team has roots in Docker, influencing the manifest format.
- Manifest Contents:
config
: Contains media type, digest, and size (not detailed).layers
: Array of config objects, each with media type, digest, and size.- First layer usually contains the model with a unique SHA-256 digest.
- Digests serve as fingerprints and filenames in the
blobs
directory.- Blobs Directory:
- Contains large files not suitable for opening in standard code editors.
- License and Templates:
- License files and templates also have unique SHA-256 digests.
- Templates can be shared across different models.
- Model Management Commands:
olama cp
: Copies a model.olama create
: Creates a new model.olama rm
: Deletes a model but retains blobs if still referenced.- Blob File Management:
- Blob files are kept as long as a model or manifest references them.
- Deleting models may not free up space if blobs are shared.
- Adding models may not consume more space if based on the same source model.
- Conclusion:
- Explains model storage, naming, and deletion in Olama.
- Encourages questions, likes, and subscriptions for more content.
[Music]
Goodbye
[Music]