top of page

How to run an LLM on your laptop in a few minutes using Ollama

  • Writer: Roshni Devadiga
    Roshni Devadiga
  • Jun 14, 2024
  • 2 min read


Generative AI
Generative AI

Large language models (LLMs) have become a cornerstone of modern AI, capable of generating text, translating languages, and writing different kinds of creative content.  Previously, these powerful tools required beefy servers or cloud access.  However, Ollama empowers you to leverage LLMs on your personal laptop in just a few minutes.


What are Large Language Models (LLM)?

Large language models (LLMs) are a type of artificial intelligence (AI) that excel at processing and generating human language. Trained on massive datasets of text and code, they can perform tasks like:

  • Text generation: Create different creative text formats, from poems and code to scripts and musical pieces.

  • Machine translation: Translate languages with high accuracy and fluency.

  • Question answering: Provide informative responses to your questions.

  • Text summarization: Condense lengthy pieces of text into concise summaries.


Major LLM Players:

The LLM landscape is constantly evolving, with new models emerging all the time.  Here are a few of the major players to give you a sense of the current scene:

  • Llama (Meta AI):  A family of open-source LLMs, including the recently released Llama 3 series with varying sizes (e.g., 8B, 13B) known for strong performance and diverse capabilities.

  • Claude (Anthropic):  A commercially available LLM focused on safety and reliability, used in popular productivity tools like Slack and Notion.

  • GPT-n (OpenAI):  This proprietary series, with the latest iteration rumored to be GPT-4o, is known for its powerful text generation abilities. It's used in applications like Microsoft products and Duolingo.

  • Gemini (Google AI): You might have encountered me! I'm a large language model developed by Google AI, focused on informative and comprehensive responses.


Getting Started with Running LLM on laptop using Ollama

Ollama is an open-source platform that streamlines the deployment and interaction with LLMs on your local machine. It simplifies the process, eliminating the need for complex configurations or coding knowledge.


Now that you have a taste of the LLM world, let's dive into using Ollama to run them on your laptop.


  • Install Ollama from their official website

  • You can pull in the LLM via ollama onto your local machine by using the command “ollama pull <model name>”. For eg, if you want to pull the recently released mistral model (which is great for all kinds of general purpose tasks, you can use the command

ollama pull mistral

The above command will download the mistral LLM which will be roughly around 3–4 Gb

  • Now simply you can prompt mistral model using ollama command line to ask any questions. You just need to type the “ollama run <model name>” command

ollama run mistral

That's it! Isn't it awesome!!


Ollama offers advanced features for customizing your experience. You can use system prompts to tailor the LLM's behavior or even fine-tune models for specific tasks (although this requires more technical expertise).


Embrace the Future of AI

With Ollama, you can experiment with cutting-edge LLMs directly on your laptop. This opens doors for exploration, learning, and even creative projects. So, fire up Ollama and unleash the power of AI on your local machine!








Comments


bottom of page