How to run already downloaded model in ollama
September 20, 2024
In this blog we are going learn how to run already downloaded .gguf files into ollama. For this we are going to use Windows machine today. For other operating system the process is very much similar, you just have to change the path as needed.
First you have to install ollama in your machine. You can visit and download it from there and install into your computer.
For this tutorial you need a .gguf file which you can download from various places. We are going to download it from huggingface.co. We are going to use Meta-Llama-3.1-8B-Instruct-Q4_K_M.gguf model file.
You can search this name at huggingface.co and download it from there.
Make sure your ollama is installed properly by opening the command prompt and run ollama -v.
Then follow these steps:
Meta-Llama-3.1-8B-Instruct-Q4_K_M.gguf file to this folder C:\Users\YOUR_USER_NAME\.ollama\models of your windows.Meta-Llama ( you can use any supported name you want ) and open it in your any text editor. Don't give any file extension to it, like .txt or anything..gguf file. In our case the path is **C:\Users\YOUR_USER_NAME\.ollama\models\Meta-Llama-3.1-8B-Instruct-Q4_K_M.gguf.
So in the Meta-Llama file we are going to write:
FROM C:\Users\YOUR_USER_NAME.ollama\models\Meta-Llama-3.1-8B-Instruct-Q4_K_M.gguf
ctrl+l, type cmd and hit enter to open the command prompt )ollama create meta-llama -f C:\Users\YOUR_USER_NAME\.ollama\modelfiles\Meta-Llama
I am giving meta-llama as the name, you can give yours.
ollama list. You should see the details of the create model as NAME: meta-llama:latest.ollama run meta-llama. And start chatting with the model.