Local & Open-Source AI Part 1: Local AI Setup Guide 2026: Hardware, Gemma 4 & SD 3 Medium on AMD

Local and Open-Source AI Part 1: Local AI Setup Guide 2026 Hardware Gemma 4 and SD 3 Medium on AMD Banner
Part 1: Complete Hardware Setup Guide for Local AI, Google Gemma, and SD 3 Medium on AMD.



Most people who try to run AI on their own computer get stuck in the same place: they can't tell whether their machine is powerful enough, so they either give up or download something far too large and watch it crawl. The answer depends on a handful of numbers, mainly how much video memory and system memory you have, and once you know those, the choice becomes simple.

This is Part 1 of The Local & Open-Source AI Masterclass. It covers how local AI differs from cloud tools, what Google's Gemma and Stable Diffusion 3 Medium actually are, which hardware each one needs, and how to prepare Python and your libraries so the later parts run smoothly.

One thing to know up front: figures in this guide come from Google's published model documentation, Ollama's model tags, and AMD and Stability AI announcements. Local AI changes quickly, so treat every number as a starting point and confirm it on the official model page before you download anything large.

Local AI vs Cloud AI: What Actually Changes

When you use ChatGPT, Claude, or Gemini in a browser, your prompt travels to a company's servers, gets processed there, and the answer comes back. You pay with a subscription or per use, and you depend on that company's service staying available and unchanged.

Local AI reverses that arrangement. You download an open-weight model once, and it runs on your own machine. Your prompts are processed by your own processor and graphics card.

Feature Cloud AI Local Open-Source AI
Where it runs Provider's servers Your own computer
Cost model Subscription or per-use fees Hardware and electricity, no per-prompt fee
Works offline No Yes, after the model is downloaded
Model quality ceiling Highest, using the largest models Limited by your hardware
Setup effort Almost none Real, but one-time
Control over changes Provider decides You decide when to update

Why Privacy Is the Main Reason Many People Switch

If you work with client documents, unpublished writing, internal code, or personal records, keeping that material on your own machine removes one category of risk: the content never leaves your device during processing.

It's worth being precise about what this does and doesn't mean. Running a model locally keeps your prompts on your computer. It doesn't automatically make the whole setup private. Some tools, Ollama among them, offer optional cloud-hosted models alongside local ones, so confirming that the model you chose is actually running locally is a sensible habit. The first download also has to come from somewhere, so your machine does connect to the internet at that stage.

Platform dependence is the other practical reason. When a company retires a feature, as OpenAI has done with Custom GPTs, anything built purely on top of it has to move. This site's outlook on the Custom GPT retirement covers why keeping your core work portable matters, and local models are one way to do that.

The Tech Stack: Gemma and Stable Diffusion 3 Medium

This series uses two models that suit different jobs. One writes and reasons with text. The other generates images.

Google Gemma: Open Models for Text, Code, and More

Gemma is Google DeepMind's family of open-weight models, built using research related to its Gemini models. The newest generation, Gemma 4, was released in April 2026 under the Apache 2.0 license, and Ollama added support for it almost immediately.

A correction worth making: the sizes many older guides list, such as 2B, 7B, 9B, and 27B, belong to earlier Gemma generations. Gemma 3 used 1B, 4B, 12B, and 27B. Google's current documentation for Gemma 4 lists these sizes:

Model Type Context window Notes
E2B Small, on-device 128K Accepts text, images, and audio
E4B Small, on-device 128K Accepts text, images, and audio; Ollama's default
12B Mid-size 256K Balanced option
26B A4B Mixture of experts 256K 25.2B total parameters, about 3.8B active per token
31B Dense 256K Highest quality in the family

The "A4B" naming describes a mixture-of-experts design. The model holds about 26 billion parameters in total but only activates a small share of them for each token it produces, which is why it can run faster than its size suggests. Google's own guidance describes the 26B A4B as a sensible starting point for many tasks when you have the memory for it.

Stable Diffusion 3 Medium and AMD's Version

Stable Diffusion 3 Medium is an image-generation model from Stability AI that turns a text description into a picture. It's smaller than the largest image models, which is exactly why it suits local use.

AMD worked with Stability AI to release an optimized build aimed at Ryzen AI 300-series laptops, designed to run on the processor's built-in neural processing unit, the NPU. AMD describes this as letting image generation happen entirely on the device, without an internet connection after setup. Reports on the release mention a system memory requirement in the region of 24 GB, so check AMD's current page for the exact figure for your machine.

There's a separate route for people with a Radeon graphics card: an AMD-optimized version of the model is published on Hugging Face under Stability AI's name. Part 3 covers both routes and how to choose between them.

Why These Two Are Popular

Both can be downloaded and run without per-use fees, both work offline after the first download, and both have an active community writing guides and tools around them. For a creator or developer, that combination is the appeal: predictable cost and control over the setup. Whether that trade is worth it depends on your needs, which Part 4 examines in detail.

Check each model's license before using outputs commercially. Gemma 4 is released under Apache 2.0, while Stable Diffusion models have used Stability AI's own community license terms, so reading the current terms for the exact version you download is worthwhile.

Hardware Requirements: What You Actually Need

There's no single answer, because the right requirement depends on which model and which compression level you choose. What matters most is video memory, the VRAM on your graphics card, or on a laptop with shared memory, the total system memory.

Gemma 4 Memory Needs

Google's published figures for the model weights alone, using 4-bit quantization, are about 2.9 GB for E2B, 4.5 GB for E4B, 6.7 GB for the 12B, 14.4 GB for the 26B A4B, and 17.5 GB for the 31B. Weights alone isn't the whole story. You also need room for the context the model keeps in memory, so budget extra headroom.

In practical terms, Ollama's published guidance for Gemma 4 suggests roughly the following:

Model Comfortable starting point
E2B About 8 GB of system memory (16 GB is more comfortable)
E4B About 10 GB of VRAM, or 16 GB of unified memory
26B A4B 20 GB or more of memory
31B About 24 GB of VRAM, or 32 GB of unified memory

If you're unsure where to begin, E4B is the sensible first choice for most laptops, and it's what Ollama installs by default when you request Gemma 4 without a size.

A Note on Context Length

Memory use grows with the amount of text the model holds in context. A long conversation or a large document can use far more memory than a short prompt does, so a model that runs comfortably in a quick test may slow down or run out of memory on a long task. Starting with a moderate context length and increasing it gradually avoids this.

Stable Diffusion 3 Medium

Requirements vary with image size, numerical precision, and which text encoders are loaded, so this guide avoids quoting a single figure as official. As a rule of thumb rather than a guarantee, a graphics card with 8 GB of VRAM is a workable floor for modest image sizes, and 12 GB or more gives more room. For AMD's NPU edition on Ryzen AI laptops, follow AMD's own listed requirements, including the system memory figure mentioned above.

CPU, RAM, and Storage

A modern multi-core processor is enough for the CPU's role, which is mostly loading data and coordinating work. System RAM of 16 GB is a reasonable minimum, and 32 GB gives room to work. Storage matters more than people expect: models run from a few gigabytes to tens of gigabytes each, and keeping several around adds up quickly, so an SSD with 100 GB or more of free space is a practical starting point.

AMD Compatibility: What to Check

AMD graphics cards use a software layer called ROCm for AI work in place of NVIDIA's CUDA. Support depends on your specific graphics card model and your operating system. ROCm builds of PyTorch have traditionally been strongest on Linux, with support elsewhere expanding over time. Check AMD's current compatibility page for your exact card before planning a setup around it, and before buying hardware for this purpose.

How to Check What You Have

On Windows, open Task Manager, go to the Performance tab, and select your GPU to see its dedicated memory. On Linux with an AMD card, the rocm-smi tool reports memory, assuming ROCm is installed. On a laptop with shared graphics memory, your total system RAM is the relevant figure.

A Simple Way to Benchmark Your Own Machine

Once Ollama is installed, running a model with the verbose flag prints speed statistics after each reply:

ollama run gemma4:e4b --verbose

Look at the evaluation rate, reported in tokens per second. Running the same prompt on two model sizes tells you quickly how much speed you give up for quality, based on your own hardware instead of someone else's numbers.

Environment Setup: Step by Step

This setup prepares your machine for the whole series. Commands are shown in a generic form, so adjust paths for your operating system.

Step 1: Install Python and Git

Check whether they're already installed:

python --version
git --version

If either is missing, install Python from python.org and Git from git-scm.com. Check each library's documentation for the Python versions it supports, since the newest Python release isn't always supported by every AI library yet.

Step 2: Create a Virtual Environment

A virtual environment keeps this project's libraries separate from everything else on your computer, which prevents version conflicts later.

python -m venv localai

Activate it. On Windows:

localai\Scripts\activate

On Linux or macOS:

source localai/bin/activate

Step 3: Update pip and Install the Core Libraries

python -m pip install --upgrade pip
pip install transformers accelerate diffusers safetensors

Transformers handles text models such as Gemma. Diffusers handles image models such as Stable Diffusion. Accelerate helps manage memory and devices, and safetensors loads model files safely. One compatibility note: a community benchmark repository for Gemma 4 reports that native support for its mixture-of-experts models requires Transformers version 5.5.0 or newer, so keep the library up to date.

Step 4: Install PyTorch for Your Hardware

PyTorch is the engine underneath both libraries, and the correct build depends on your graphics hardware. Rather than copying a command from an article that may be out of date, open the selector on pytorch.org, choose your operating system and compute platform, and copy the exact command it gives you. AMD users should look for the ROCm option where it's offered for their system.

Then verify the installation:

python -c "import torch; print(torch.__version__); print(torch.cuda.is_available())"

On ROCm builds, PyTorch reports AMD GPUs through the same cuda interface, so a result of True means your graphics card is detected.

Step 5: Log In to Hugging Face

Many models are hosted on Hugging Face, and some require you to accept license terms before downloading. Create a free account, accept the terms on the model's page, then log in from your terminal:

hf auth login

Older guides use huggingface-cli login for the same step, so use whichever your installed version supports.

Step 6: Install Ollama for the Easiest Path to Gemma

Ollama is the simplest way to run Gemma locally, and Part 2 uses it. Install it from ollama.com, then check the version:

ollama --version

Gemma 4 support requires Ollama version 0.20.0 or newer, so update if yours is older.

Common Setup Problems and Quick Fixes

  • No GPU Detected: If PyTorch reports no GPU, the most common cause is installing the wrong build for your hardware, so reinstall using the selector.
  • Extremely Slow Performance: If a model runs but extremely slowly, it's usually too large for your memory and spilling into system RAM, so try a smaller size.
  • Download Access Error: If a download fails with an access error, you likely haven't accepted the model's license on Hugging Face yet.
  • Out-of-Memory Error: If you hit an out-of-memory error partway through a long task, reduce the context length before changing anything else.

Frequently Asked Questions

Can I run local AI without a dedicated graphics card?

Yes, with limits. Smaller models such as Gemma 4 E2B can run on a CPU with enough system memory, though more slowly than on a graphics card. For image generation, a graphics card or a supported NPU makes a large difference.

Is running AI locally really private?

It keeps your prompts on your own machine during processing, which is a meaningful privacy benefit. It isn't automatic privacy for the whole setup, so confirm your model is running locally and check any optional cloud features in your tools.

Do I need an AMD graphics card to follow this series?

No. Gemma runs on a range of hardware. The AMD-specific material in Part 3 is for people using AMD hardware, and the general ideas still apply on other systems.

Which Gemma size should I start with?

E4B suits most laptops and quick first runs. If you have a graphics card with 20 GB or more of memory, the 26B A4B model is worth trying.

Is local AI better than cloud AI?

It depends on what you value. Cloud services offer the largest, most capable models with no setup. Local AI offers control, offline use, and no per-prompt fees, within the limits of your hardware.

What's Next in This Series

This part covered the foundations: how local and cloud AI differ, what Gemma and Stable Diffusion 3 Medium are, what hardware you need, and how to prepare your environment.

Part 2 installs Gemma and runs it, covering Ollama and Hugging Face, how to choose a size, prompt techniques, and a basic approach to customizing the model.


The Local & Open-Source AI Masterclass

Related Reading

Disclaimer: This article is for general informational purposes only. Model sizes, memory figures, software versions, and license terms reflect publicly available information as of publishing and change frequently. Always check the official model pages, Ollama documentation, and AMD's compatibility information before downloading large files or buying hardware.

No comments:

Post a Comment

Popular Posts