Delv
Ollama
Getting Started Guide

How to Use Ollama

A practical guide to get you up and running with Ollama. Written by Delv Editorial, Delv Team.

Getting started with Ollama

In this guide, you'll learn how to run large language models locally using Ollama with just one command. After reading this, you'll be able to set up the tool and execute your first model quickly.

Step 1: Sign up and set up

  1. Go to ollama.com.
  2. Click on the "Get Started" button on the homepage.
  3. Follow the prompts to download Ollama for your operating system (currently available for macOS and Windows).
  4. After downloading, install the application by following the on-screen instructions.
  5. Once installed, open your terminal (Command Prompt for Windows or Terminal for macOS) and type ollama to check if it’s working. You should see a list of commands.

Step 2: Your first model

  1. In the terminal, type ollama run llama to run the Llama model.
  2. After a moment, you should see a prompt where you can input text. Type your query or prompt and press Enter.
  3. Wait for the model to generate a response, which will appear below your input.

Step 3: Get better results

  1. To use a different model, such as Mistral or Gemma, simply replace "llama" in the command with the model name, e.g., ollama run mistral.
  2. Experiment with different prompts to see how the models respond. For example, try asking for a summary of a topic or to generate creative content.
  3. Use the --help flag with any command, like ollama run --help, to see options and parameters you can adjust for better results.

Pro tip

Most beginners miss the ability to chain commands. You can run multiple models in succession by using && in your terminal. For example: ollama run llama && ollama run mistral. This saves time and allows for quick comparisons.

Common mistake to avoid

A common mistake is forgetting to check if the model you want to run is already downloaded. Use the command ollama list to see available models and ensure you have the one you want before trying to run it.