Importing a model brings external GGUF or Safetensors weights into Ollama so the model can be run through the normal CLI and API. The Modelfile describes whether Ollama should load a model file, a directory of weights, or an adapter.

The import source and base model must match the weights. A LoRA or Safetensors adapter built for one base model can behave unpredictably if the Modelfile points at a different base.

Use a small test import before moving large production weights. Model conversion and quantization can consume significant disk and memory.

Steps to import a model into Ollama:

  1. Place the GGUF or Safetensors source in a local directory.
    $ ls /srv/models/custom-model
    model.gguf
  2. Create a Modelfile that points at a GGUF model file.
    FROM /srv/models/custom-model/model.gguf
  3. Create the Ollama model name from the Modelfile.
    $ ollama create example/custom-model -f Modelfile
    transferring model data
    writing manifest
    success
  4. Run the imported model.
    $ ollama run example/custom-model "Return OK."
    OK
  5. Inspect the model before publishing or using it in automation.
    $ ollama show example/custom-model
      Model
        architecture        llama
    ##### snipped #####