Principle:Ollama Ollama Base Model Resolution
| Knowledge Sources | |
|---|---|
| Domains | Storage, Model_Management |
| Last Updated | 2026-02-14 00:00 GMT |
Overview
A manifest-based model resolution mechanism that decomposes a model name into its constituent layers (weights, config, template, system prompt, parameters) for re-composition into derivative models.
Description
Base Model Resolution is the process of loading an existing model's layers so they can be used as the foundation for a new custom model. When a Modelfile specifies FROM llama3, the system must locate the llama3 manifest, parse its layers, and extract the GGML model data, chat template, system prompt, and parameter defaults.
This allows model creation to be a compositional operation: take an existing model's weights, override specific configuration layers (system prompt, template, parameters), optionally add adapters, and create a new manifest pointing to the same weight blobs with different metadata layers.
Usage
Use this principle when implementing model derivation or customization systems where new model variants are created by overriding metadata layers on top of existing model weights.
Theoretical Basis
The resolution process:
- Name Parsing: Parse the model name into its components (host, namespace, model, tag).
- Manifest Lookup: Find the manifest file in the local model store.
- Layer Enumeration: Read each layer from the manifest, categorized by media type.
- GGML Parsing: For model weight layers, parse the GGUF header to extract architecture metadata.
- Layer Extraction: Return the parsed layers for the creation pipeline to compose with overrides.