How to download a model manually in Ollama?

You will download a model automatically if you run “ollama run xxx” for the first time. But I want to download the model directly from a webpage and import it to ollama. How should I do?

 

You can download a model file directly from a webpage (like Hugging Face) in GGUF format and import it into Ollama using a local configuration file called a Modelfile

 

 

A GGUF file is a single binary file that contains an AI model’s weights and metadata. Ollama is the local tool that runs these models on your computer.

 

Step 1: Download the GGUF File from a Webpage

  • Look for a repository that offers GGUF versions of the model (for example, search for Llama-3.2-3B-Instruct-GGUF).

  • Go to the Files and versions tab.

  • Choose a quantized file size that fits your computer’s memory (e.g., Q4_K_M is a good balance of speed and quality).

  • Click Download to save the .gguf file directly through your web browser. Move this file to a permanent folder on your computer (e.g., C:\Models\ or ~/Documents/LLM/).
Step 2: Create a Modelfile

  • Create a new, blank text file in the same folder where you saved your .gguf file.

  • Name the file Modelfile and make sure it has no file extension (do not save it as Modelfile.txt).

  • Open the file in a text editor (like Notepad or VS Code) and add a single line pointing to your downloaded file:
    dockerfile
    FROM /path/to/your/downloaded-model-file.gguf
    

    (If you are on Windows, use the full path like FROM C:\Models\model-name.gguf. On Mac/Linux, use /Users/name/Models/model-name.gguf)save and close the file.

Step 3: Import the Model into Ollama

  • Open your terminal (Command Prompt, PowerShell, or Terminal).

  • Run the ollama create command to import the model into your local Ollama library, giving it a custom name of your choice:
    bash
    ollama create my-custom-model -f /path/to/your/Modelfile
    
    
    Once the import finishes, run your newly added model offline using the standard command:
    
    ollama run my-custom-model

Did you like this?
Tip admin with Cryptocurrency

Donate Bitcoin to admin

Scan to Donate Bitcoin to admin
Scan the QR code or copy the address below into your wallet to send some bitcoin:

Donate Bitcoin Cash to admin

Scan to Donate Bitcoin Cash to admin
Scan the QR code or copy the address below into your wallet to send bitcoin:

Donate Ethereum to admin

Scan to Donate Ethereum to admin
Scan the QR code or copy the address below into your wallet to send some Ether:

Donate Litecoin to admin

Scan to Donate Litecoin to admin
Scan the QR code or copy the address below into your wallet to send some Litecoin:

Donate Monero to admin

Scan to Donate Monero to admin
Scan the QR code or copy the address below into your wallet to send some Monero:

Donate ZCash to admin

Scan to Donate ZCash to admin
Scan the QR code or copy the address below into your wallet to send some ZCash:
Posted in

Leave a Reply