Home Artificial Intelligence Automation Programming Cybersecurity Productivity Reviews About Contact
Artificial Intelligence

Run AI Locally: A Beginner's Guide to Ollama and Open-Source Models

Run AI Locally: A Beginner's Guide to Ollama and Open-Source Models
Table of Contents


    Running an AI model on your own machine used to require a GPU, a Python environment, and an afternoon of dependency troubleshooting. Ollama reduced that to a single download and one command.

    You do not get the same quality as a frontier cloud model. You do get privacy, no per-token billing, and an offline assistant that works when your connection does not. For a lot of everyday tasks, that trade is worth making.

    What Ollama Actually Does

    Ollama is a local runtime for open-weight language models. It downloads a quantized version of a model, serves it on your machine, and exposes an API you can call from code or from the command line.

    The key word is quantized. Full-precision models are enormous. Ollama ships models in a 4-bit format that cuts the weight size to roughly 0.6GB per billion parameters, with a modest quality cost. That compression is what makes a 7B model fit on a laptop instead of a server rack.

    Ollama runs on macOS, Windows, and Linux, with no account required and no CUDA setup if you are on a supported GPU. On CPU, it still works, just slower.

    Check Your Hardware Before You Download

    The single number that matters is memory. As a rough rule, plan on about 1GB of RAM or VRAM per billion parameters at the default quantization. A 7B model wants around 8GB. A 13B model wants 16GB.

    Model Size Examples Minimum RAM/VRAM
    3B Llama 3.2 3B, Phi-3 Mini 4GB
    7–8B Mistral 7B, Llama 3.1 8B 8GB
    13B Llama 2 13B 16GB
    22–34B Codestral 22B 24GB
    70B Llama 3.1 70B 48GB

    On an Apple Silicon Mac, unified memory is shared between CPU and GPU, so a 16GB M-series machine runs 7–8B models comfortably. On Windows, you need Windows 10 22H2 or newer, and an NVIDIA driver at 551.61 or higher if you have an NVIDIA card. AMD cards work through ROCm or Vulkan, with Vulkan as the fallback for cards that do not expose ROCm on current drivers.

    If you have 8GB of total system memory and a browser open, a 7B model will crawl. Check the free memory first, not the advertised RAM.

    Install Ollama

    Download the installer from ollama.com and run it. On macOS and Windows, it installs as a native app and starts a background service. On Linux, the install script registers Ollama as a systemd service.

    Once installed, confirm it is running with:

    ollama -v

    If that prints a version number, you are ready to pull a model.

    Pull and Run Your First Model

    The two commands that matter are pull and run. pull downloads a model. run starts an interactive session with it.

    Start with a small model that fits your machine comfortably. For an 8GB system, a 3B or 4B model is the safe choice:

    ollama pull llama3.2
    ollama run llama3.2

    You will get a prompt. Type a question and press enter. The model runs entirely on your machine. To exit, type /bye or press Ctrl+D.

    To see what you have downloaded:

    ollama list

    To remove a model you no longer need:

    ollama rm llama3.2

    Which Model Should You Actually Pull?

    The model landscape moves fast. The practical advice is to match the model to your hardware and your task, not to chase the leaderboard.

    For a general-purpose assistant on a consumer machine, a 7B to 12B model is the sweet spot. Gemma 4 12B is a reasonable default at roughly 7GB in Q4, fitting an 8–12GB GPU or a 16GB Mac. Qwen3.6-27B is stronger but needs a 24GB GPU and about 16GB of weights, which puts it out of reach for most laptops.

    For coding specifically, a smaller code-tuned model on modest hardware often beats a larger general model. On a 24GB card, Qwen3-Coder models are a common pick, though they are overkill if you have 8GB.

    For tool-calling and agent-style work, the practical ceiling arrives earlier than the leaderboards suggest. Tool-selection accuracy tends to level off around the 7B mark, and the deciding factor becomes consistency across runs rather than peak score. A model that performs well once but varies wildly is not usable for automation.

    Ignore the headline models that need multi-GPU servers. The largest open-weight models need hundreds of gigabytes of VRAM and are not beginner hardware, even if Ollama can technically serve them.

    Call It From Code: The OpenAI-Compatible Endpoint

    This is the feature that makes Ollama more than a toy. It exposes an OpenAI-compatible API at http://localhost:11434/v1. Any code written for the OpenAI SDK can point at Ollama by changing the base URL and using a placeholder API key.

    import OpenAI from "openai";
    
    const client = new OpenAI({
      baseURL: "http://localhost:11434/v1/",
      apiKey: "ollama",
    });
    
    const response = await client.chat.completions.create({
      model: "llama3.2",
      messages: [{ role: "user", content: "Explain environment variables in one paragraph." }],
    });
    
    console.log(response.choices[0].message.content);

    The API key is required by the SDK but ignored by Ollama. You can develop against a local model and switch to a cloud provider later by changing the base URL and key, or the reverse if you want to cut costs on development.

    The native Ollama API at http://localhost:11434/api offers more features than the OpenAI-compatible layer, including model management. For most beginners, the OpenAI-compatible endpoint is the easiest path because it works with existing code and tutorials.

    What Local Models Are Good For (and Not)

    Local models are good at summarization, drafting, rewriting, code completion, and answering questions about documents you do not want to upload. They are good at offline work. They are good at tasks where latency does not matter.

    They are not good at matching a frontier model on complex reasoning, long-context analysis, or tasks that require broad world knowledge. A 7B model running on your laptop is not GPT-5 or Claude. It is a capable assistant with a smaller brain and no internet connection.

    They are also not free of risk. The Ollama updater on Windows had two vulnerabilities disclosed in 2026, affecting versions 0.12.10 through 0.17.5, involving update signature verification and path traversal. If you are on an affected version, reinstall from a freshly downloaded installer rather than relying on the auto-updater. Check your version with ollama -v after installing.

    Frequently Asked Questions

    Does Ollama work without a GPU?

    Yes. It runs on CPU, just much slower. A 7B model on CPU might generate a few tokens per second instead of dozens. For occasional use, it is workable. For regular use, a supported GPU or Apple Silicon chip makes a large difference.

    How much disk space do models take?

    At default Q4 quantization, roughly 0.6GB per billion parameters. A 7B model is about 4–5GB on disk. A 13B model is around 8GB. Plan for several models if you want to experiment.

    Can I use Ollama with my existing OpenAI code?

    Yes. Point the base URL at http://localhost:11434/v1 and use any non-empty string as the API key. The SDK will call your local model instead of the cloud.

    Which model should I start with?

    If you have 8GB of memory, start with a 3B model like Llama 3.2. If you have 16GB, a 7–8B model like Mistral 7B or Gemma 4 12B is a better balance of quality and speed. Do not start with a 27B model unless you have a 24GB GPU.

    Is Ollama safe to leave running?

    By default, the local API is only accessible from your machine, not the network. Keep it that way unless you know how to secure it. The 2026 update vulnerabilities were patched in later versions, but the lesson is to check your version and update deliberately rather than assuming the auto-updater handled it.

    The first model you pull will feel slow, and the answers will feel smaller than what you are used to from a cloud assistant. That is the trade. What you get in return is a model that runs when the internet does not, that never sends your document to a server, and that costs nothing per query. For a freelancer who works with client data or writes on the move, that is a reasonable exchange.

    Johnson Jones
    Johnson Jones
    Writer at AutomationEdge — covering AI, automation, and practical tools.