AI vendors are switching from subscriptions to consumption pricing. AI PCs are the hedge.
Back to Tutorials
aiTutorialbeginner

AI vendors are switching from subscriptions to consumption pricing. AI PCs are the hedge.

July 27, 202621 views4 min read

Learn how to set up and use Ollama to run local AI models, avoiding expensive cloud-based subscriptions and gaining more control over AI usage.

Introduction

In recent years, AI tools have evolved from simple add-ons to essential business components. Major vendors are shifting away from traditional subscription models to consumption-based pricing, where you pay based on actual usage. This change is prompting businesses to consider local AI solutions to control costs and maintain performance. In this tutorial, you'll learn how to set up and use a local AI model using Ollama, a tool that makes running AI models on your own machine simple and accessible.

This tutorial will guide you through installing Ollama, downloading an AI model, and running basic AI interactions locally. By the end, you'll understand how local AI can help you avoid cloud-based pricing models and gain more control over your AI usage.

Prerequisites

  • A computer running Windows, macOS, or Linux
  • At least 8GB of RAM (16GB recommended)
  • Internet connection for downloading Ollama and AI models
  • Basic familiarity with command-line interfaces (terminal or command prompt)

Step-by-Step Instructions

1. Install Ollama

Ollama is a tool that makes it easy to run AI models on your local machine. It's designed to be simple to use, even for beginners.

Why: Ollama simplifies the process of running AI models locally, eliminating the need for complex setup or cloud-based subscriptions.

For Windows:

  1. Visit the Ollama download page
  2. Download the Windows installer
  3. Run the installer and follow the prompts

For macOS:

  1. Open Terminal
  2. Run the following command:
    brew install ollama

For Linux:

  1. Open Terminal
  2. Run the following command:
    curl -fsSL https://ollama.com/install.sh | sh

2. Start Ollama

After installation, you need to start the Ollama service so that it can run AI models.

Why: The service must be running to interact with AI models.

On Windows, you can start Ollama from the Start Menu. On macOS or Linux, run:

ollama serve

3. Download an AI Model

Ollama supports many AI models, but for beginners, we'll use the llama3 model, which is a powerful and efficient AI that can handle a wide range of tasks.

Why: The llama3 model is a great starting point because it's well-documented, efficient, and performs well on local hardware.

Run the following command in your terminal:

ollama run llama3

4. Interact with the AI Model

Once the model is downloaded and running, you can start asking questions or giving prompts to the AI.

Why: This step demonstrates how you can use the AI model locally, without needing to pay for cloud-based services.

After running the command, you'll see a prompt like >>> . Type in a question or instruction, for example:

Explain what AI is in simple terms.

5. Explore More Models

Ollama supports many other models. You can explore them by running:

ollama list

And to pull a different model, use:

ollama pull codellama

Why: Different models are optimized for different tasks, so exploring them helps you find the best one for your needs.

6. Stop the Ollama Service

When you're done using the AI models, you can stop the Ollama service to free up system resources.

Why: Stopping the service helps conserve your computer's resources and ensures the system is clean when you're done.

Run the following command in your terminal:

ollama stop

Summary

In this tutorial, you've learned how to set up and use Ollama to run AI models locally. You installed Ollama, downloaded the llama3 model, and interacted with it using simple prompts. This approach gives you control over your AI usage and avoids the need for expensive cloud subscriptions.

As AI pricing shifts toward consumption-based models, tools like Ollama help you stay in control of costs and performance. Whether you're a student, developer, or business owner, local AI can be a powerful alternative to traditional cloud-based AI services.

Source: TNW Neural

Related Articles