A model distributed outside the Ollama library may arrive as a GGUF weight file. Ollama can import that local file under a reusable model name for CLI and API requests.
A GGUF import retains the file's quantization. Chat formatting comes from the GGUF metadata or a matching Modelfile template; a bare weight file does not inherit the separate settings of an Ollama library package.
The input must be a complete, compatible GGUF model from a trusted source whose license permits the intended use. Ollama must already be running, with enough disk space for the imported weights and enough memory to load the model.
Steps to import a model into Ollama:
- Check the downloaded GGUF file in the working directory.
$ ls -lh model.gguf
model.gguf is the local filename of a complete model, such as a Qwen2.5 0.5B Instruct GGUF, rather than an adapter or an Ollama model name. The filename must match the path in the Modelfile. A missing-file error means the weights are not at that path.
- Save a file named Modelfile that points to the local weights.
- Modelfile
FROM ./model.gguf
The relative path is resolved from the Modelfile's directory. A file elsewhere can be named with its absolute path. The FROM instruction imports the existing GGUF without converting or quantizing it.
- Import the weights under the name example/imported-chat.
Creating a model with an existing name replaces that name's saved configuration. An unused local name preserves any earlier model.
$ ollama create example/imported-chat -f Modelfile
The -f option selects the Modelfile. A completed import ends with success; it does not publish the model to a registry. A connection error means the Ollama server is unavailable.
Related: How to start the Ollama server - Inspect the imported model's architecture and quantization.
$ ollama show example/imported-chat Model architecture qwen2 parameters 494.03M context length 32768 embedding length 896 quantization Q4_K_M template source gguf_chat_template ##### snipped #####
These values describe the Qwen2.5 0.5B GGUF. Another model can report different metadata. A recognized chat template provides message formatting, but does not guarantee that every model follows instructions. Custom prompt settings belong in the Modelfile.
Related: How to create a custom Ollama model - Run the imported model with a short arithmetic question.
$ ollama run example/imported-chat "What is 17 plus 25? Answer in one short sentence." The sum of 17 and 25 is 42.
The answer should express 42; wording can vary. A returned answer shows that Ollama can load the imported weights and process a prompt. The model name remains available for later requests.