ollama/ollama
Model name
A model name is a structured string like gemma3 or library/gemma3:latest or registry.ollama.ai/library/gemma3:latest. The parsed form is model.Name in types/model/.
Purpose
Be the single canonical type for a model identifier. Every API call, every CLI subcommand, and every storage path uses it.
Components
[host/][namespace/]model[:tag][@digest]| Field | Default | Notes |
|---|---|---|
| Host | registry.ollama.ai |
Where to pull/push. |
| Namespace | library |
The collection. |
| Model | required | The specific model. |
| Tag | latest |
Variant. |
| Digest | empty | Pin to a content-addressed manifest digest. |
model.ParseName(s) (types/model/) returns a Name and Name.IsValid() checks the result. Used everywhere the user can supply a model name (Server.scheduleRunner, CreateHandler, every CLI handler).
Capabilities
A model's declared capabilities are in types/model/capabilities.go:
chattoolsembeddingvisionthinkingcompletioninsert
Model.CheckCapabilities(...) (server/model.go) refuses requests asking for capabilities the model doesn't advertise. The ollama show <name> output exposes them via /api/show.
Resolution
server/model_resolver.go decides whether a name resolves to a local model, a cloud-hosted model, or neither. It's used at the very top of every handler that needs a model.
Errors
model.ErrUnqualifiedName— name failed to parse.errConflictingModelSource— request supplied bothmodelandnamefields with different values.errtypes.InvalidModelNameErrMsg— public-facing message used inwriteModelRefParseError(server/routes.go).
Key source files
| File | Purpose |
|---|---|
types/model/ |
Name type and parser. |
types/model/capabilities.go |
Capability enum. |
server/model.go |
Model type with capability checks. |
server/model_resolver.go |
Local-vs-cloud resolution. |
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.