DEV Community

Kamal Hossain
Kamal Hossain

Posted on

35

How to run already downloaded model in ollama

#ai

Intro

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.

Downloading and installing the necessary files

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.

Running the model into ollama

Make sure your ollama is installed properly by opening the command prompt and run ollama -v.

Then follow these steps:

  • Move the downloaded Meta-Llama-3.1-8B-Instruct-Q4_K_M.gguf file to this folder C:\Users\YOUR_USER_NAME\.ollama\models of your windows.
  • Create a new folder called modelfiles at this path C:\Users\YOUR_USER_NAME\.ollama
  • Inside the modelfiles folder create a file called 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.
  • At the file give the path of your downloaded .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

  • Now save the file and open the command prompt at modelfiles directory. (You can just press ctrl+l, type cmd and hit enter to open the command prompt )

  • Now type

ollama create meta-llama -f C:\Users\YOUR_USER_NAME\.ollama\modelfiles\Meta-Llama
Enter fullscreen mode Exit fullscreen mode

I am giving meta-llama as the name, you can give yours.

  • It should take few moments based on your hardware and create the file.
  • To confirm type: ollama list. You should see the details of the create model as NAME: meta-llama:latest.
  • Now to run the model type: ollama run meta-llama. And start chatting with the model.

API Trace View

How I Cut 22.3 Seconds Off an API Call with Sentry 🕒

Struggling with slow API calls? Dan Mindru walks through how he used Sentry's new Trace View feature to shave off 22.3 seconds from an API call.

Get a practical walkthrough of how to identify bottlenecks, split tasks into multiple parallel tasks, identify slow AI model calls, and more.

Read more →

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay