How to Build AI Agents Locally with AMD GAIA: A Step-by-Step Guide
Introduction
AMD's GAIA (Generative AI Is Awesome) is an open-source tool that lets you build and run AI agents entirely on your local PC, using AMD CPUs, GPUs, and NPUs. With the latest release, GAIA now defaults to a better model, offering improved performance and ease of use. This guide will walk you through setting up GAIA and creating your first local AI agent step by step.
What You Need
- AMD Hardware – A modern AMD CPU (e.g., Ryzen series), GPU (Radeon), or NPU (e.g., Ryzen AI) for accelerated AI processing.
- Operating System – Windows 10/11 or a Linux distribution (Ubuntu 22.04 recommended).
- Python – Version 3.8 or newer installed on your system.
- Git – For cloning the GAIA repository.
- Command-Line Basics – Familiarity with terminal or Command Prompt commands.
- Internet Connection – For downloading the software and models (once downloaded, you can work offline).
Step-by-Step Instructions
Step 1: Prepare Your System
Ensure your AMD drivers are up to date. For GPUs, install the latest AMD Software: Adrenalin Edition. For NPUs, check your BIOS settings to enable the NPU (if available). On Linux, install the amdgpu driver stack. Verify Python and Git are installed by running python --version and git --version in your terminal.
Step 2: Clone the GAIA Repository
Open your terminal and navigate to a directory where you want to store GAIA. Run:
git clone https://github.com/amd/gaia.git
This downloads the latest version, which includes the default better model and improvements.
Step 3: Install the Lemonade SDK
GAIA relies on the Lemonade SDK for model handling. Inside the GAIA folder, run:
cd gaia
pip install lemonade-sdk
If you prefer a virtual environment (recommended), skip to Step 4 first, then return here.
Step 4: Create a Virtual Environment (Optional but Recommended)
Isolate your Python dependencies:
python -m venv gaia-env
source gaia-env/bin/activate # Linux/Mac
# On Windows: gaia-env\Scripts\activate
Now install the Lemonade SDK as in Step 3.
Step 5: Install Additional Dependencies
GAIA often includes a requirements.txt. Install it with:
pip install -r requirements.txt
This will fetch PyTorch, transformers, and other needed libraries.
Step 6: Download the Default Model
GAIA now defaults to a better model. To download it, run:
python gaia_cli.py --download-model
This starts a one-time download (a few GB). The tool will automatically select the recommended model for your hardware.
Step 7: Create Your First AI Agent
Use the GAIA API to build an agent. Create a Python script my_agent.py:
from gaia import Agent
agent = Agent(model="default")
response = agent.ask("What is the weather today?")
print(response)
Run it with python my_agent.py. The agent will process locally on your AMD hardware.
Step 8: Customize Your Agent
You can change the model, add tools (like web search), or define system prompts. Edit your script to:
agent = Agent(model="llama-3.2-3b", tools=["calculator"])
See the GAIA documentation for all options.
Step 9: Run Multiple Sessions
GAIA supports conversational agents. Use a loop to keep context:
while True:
user_input = input("You: ")
if user_input.lower() == "exit": break
print("AI:", agent.chat(user_input))
Step 10: Deploy as a Service
For persistent use, you can wrap your agent in a web server using Flask or FastAPI. GAIA includes examples in the examples/ folder. Refer to the Tips section for performance optimizations.
Tips for a Smooth Experience
- Monitor Resource Usage – Use task manager or
htopto ensure your AMD CPU/GPU/NPU is utilized. If not, check driver updates. - Model Selection – The default model works well, but you can try smaller quantized models for faster inference on lower-end hardware.
- Batch Processing – For multiple queries, batch them into a list to improve throughput.
- Stay Updated – Watch AMD’s GitHub for GAIA updates; the team releases improvements regularly.
- Offline Use – After initial model download, GAIA runs fully offline – no internet needed.
- Community Support – Join the AMD AI Discord or Reddit for troubleshooting and share your agents.
By following these steps, you’ll have a fully functional local AI agent powered by AMD hardware. Happy building!