A beginner's guide to Ollama

Imagine having a super-powered brain that can write different kinds of creative text formats, translate languages, and answer your questions in an informative way. That’s the basic idea behind Large Language Models (LLMs), and Ollama is a tool that lets you run these powerful LLMs on your own computer!

What are Large Language Models (LLMs)?

Think of an LLM as a super-fast learner that has been trained on massive amounts of text data. This data could be anything from books and articles to code and even social media conversations. By chomping through all this information, LLMs become really good at understanding and responding to language.

How does Ollama work?

Normally, LLMs are too complex to run on a regular computer. But Ollama makes things easier by providing a user-friendly platform specifically designed for LLMs. It’s like having a special program that both understands these brainy models and streamlines how you interact with them.

LLMs are pretty powerful, so your computer needs a bit of muscle to run them smoothly. Generally, you’ll need a decent amount of RAM (16GB or more is recommended) and a good graphics card. Ollama’s website has more detailed information on specific requirements for different LLMs.

Ollama’s Flexibility

Ollama stands out by giving you flexibility in how you use LLMs.

Getting started with Ollama

  1. Head over to the Ollama website: https://ollama.com/.
  2. Choose your system: Ollama works on different computer systems (Windows, macOS, and Linux).
  3. Select the appropriate download option for your setup.
  4. Most users can install Ollama with a single command. You’ll find this command on the Ollama download page – simply copy and paste it into your computer’s terminal. To run and chat with Llama 2: ollama run llama2
  5. Once you’ve downloaded and installed Ollama, you’ll be able to access a library of pre-trained LLMs.
  6. Let’s Chat! Pick an LLM that interests you and start a conversation. You can ask questions, give it writing prompts, or just have fun seeing what it can do!

Customize a prompt

Models from the Ollama library can be customized with a prompt. For example, to customize the llama2 model:

ollama pull llama2

Create a Modelfile:

FROM llama2

# set the temperature to 1 [higher is more creative, lower is more coherent]
PARAMETER temperature 1

# set the system message
SYSTEM """
You are superhero Superman. Answer as Superman, the assistant, only.
"""

Create and run the model:

ollama create superman -f ./Modelfile
ollama run superman
>>> hi
Hello! It's Superman!

For more information see documentation.

What can you do with LLMs?

LLMs open up a world of possibilities, here’s a deeper look:

LLMs are still under development, so their answers might not always be perfect. But they’re a powerful tool that can help you learn, create, and explore the world of language in new and exciting ways.

So, are you ready to unleash the power of LLMs on your own computer? Dive into Ollama and see what these super-powered brains can do!