diff --git a/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/_index.md b/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/_index.md new file mode 100644 index 0000000000..88899251ff --- /dev/null +++ b/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/_index.md @@ -0,0 +1,64 @@ +--- +title: Build RAG applications with LlamaIndex on Google Cloud C4A Axion VM + +description: Set up LlamaIndex on Google Cloud C4A Axion Arm VMs running SUSE Linux to build browser-based Retrieval-Augmented Generation (RAG) applications using local LLMs, vector databases, and FastAPI. + +minutes_to_complete: 30 + +who_is_this_for: This is an introductory topic for DevOps engineers, AI engineers, ML engineers, and software developers who want to build Retrieval-Augmented Generation (RAG) applications using LlamaIndex on SUSE Linux Enterprise Server (SLES) Arm64, integrate vector databases, and query custom documents using local LLMs. + +learning_objectives: + - Install and configure LlamaIndex on Google Cloud C4A Axion processors for Arm64 + - Build indexing and retrieval pipelines using LlamaIndex + - Integrate ChromaDB vector databases with local LLMs using Ollama + - Build and test a browser-based RAG application using FastAPI + +prerequisites: + - A [Google Cloud Platform (GCP)](https://cloud.google.com/free) account with billing enabled + - Basic familiarity with Python and AI/LLM concepts + +author: Pareena Verma + +##### Tags +skilllevels: Introductory +subjects: ML +cloud_service_providers: + - Google Cloud + +armips: + - Neoverse + +tools_software_languages: + - LlamaIndex + - Python + - ChromaDB + - Ollama + - FastAPI + +operatingsystems: + - Linux + +# ================================================================================ +# FIXED, DO NOT MODIFY +# ================================================================================ + +further_reading: + - resource: + title: LlamaIndex official documentation + link: https://docs.llamaindex.ai/en/stable/ + type: documentation + + - resource: + title: LlamaIndex GitHub repository + link: https://github.com/run-llama/llama_index + type: documentation + + - resource: + title: Ollama documentation + link: https://ollama.com/library + type: documentation + +weight: 1 +layout: "learningpathall" +learning_path_main_page: yes +--- diff --git a/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/_next-steps.md b/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/_next-steps.md new file mode 100644 index 0000000000..c3db0de5a2 --- /dev/null +++ b/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/_next-steps.md @@ -0,0 +1,8 @@ +--- +# ================================================================================ +# FIXED, DO NOT MODIFY THIS FILE +# ================================================================================ +weight: 21 # Set to always be larger than the content in this path to be at the end of the navigation. +title: "Next Steps" # Always the same, html page title. +layout: "learningpathall" # All files under learning paths have this same wrapper for Hugo processing. +--- diff --git a/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/background.md b/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/background.md new file mode 100644 index 0000000000..c1e444bfa2 --- /dev/null +++ b/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/background.md @@ -0,0 +1,38 @@ +--- +title: Learn about LlamaIndex and Google Axion C4A for RAG applications +weight: 2 + +layout: "learningpathall" +--- + +## Google Axion C4A Arm instances for AI and RAG workloads + +Google Axion C4A is a family of Arm-based virtual machines built on Google’s custom Axion CPU, which is based on Arm Neoverse V2 cores. Designed for high-performance and energy-efficient computing, these virtual machines offer strong performance for modern cloud workloads such as AI applications, vector databases, Retrieval-Augmented Generation (RAG) pipelines, and scalable inference services. + +The C4A series provides a cost-effective alternative to x86 virtual machines while using the scalability and performance benefits of the Arm architecture in Google Cloud. + +To learn more, see the Google blog [Introducing Google Axion Processors, our new Arm-based CPUs](https://cloud.google.com/blog/products/compute/introducing-googles-new-arm-based-cpu). + +## LlamaIndex for RAG and context-aware AI applications on Arm + +LlamaIndex is an open-source framework designed to build context-aware AI applications using Large Language Models (LLMs). It's widely used for Retrieval-Augmented Generation (RAG), document indexing, vector search, semantic retrieval, and integrating custom data sources with LLMs. + +LlamaIndex provides a unified framework with components such as: + +* Document loaders for ingesting custom data +* Indexing pipelines for structured retrieval workflows +* Query engines for context-aware question answering +* Vector store integrations for scalable embedding search +* LLM integrations for generating grounded responses + +Running LlamaIndex on Google Axion C4A Arm-based infrastructure enables efficient execution of AI and RAG workloads by using multi-core Arm CPUs and optimized memory performance. This results in improved performance per watt, reduced infrastructure costs, and better scalability for browser-based AI applications and local inference pipelines. + +Common use cases include browser-based AI assistants, document search applications, semantic retrieval systems, vector database integrations, enterprise knowledge bases, and context-aware chatbot applications. + +To learn more, see the [LlamaIndex documentation](https://docs.llamaindex.ai/en/stable/) and the [LlamaIndex GitHub repository](https://github.com/run-llama/llama_index). + +## What you've learned and what's next + +You've now learned about Google Axion C4A Arm-based virtual machines and their performance advantages for AI and RAG workloads. You were also introduced to core LlamaIndex components including document ingestion, indexing pipelines, query engines, vector stores, and LLM integrations. + +Next, you'll create a firewall rule in Google Cloud Console to enable remote access to the browser-based LlamaIndex RAG application used in this Learning Path. diff --git a/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/build-browser-rag-app.md b/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/build-browser-rag-app.md new file mode 100644 index 0000000000..ff6afe1bb2 --- /dev/null +++ b/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/build-browser-rag-app.md @@ -0,0 +1,402 @@ +--- +title: Build a Browser-Based RAG Application with LlamaIndex +weight: 6 + +### FIXED, DO NOT MODIFY +layout: learningpathall +--- + +## Build a Browser-Based RAG Application with LlamaIndex + +In this section, you'll build and test a browser-based Retrieval-Augmented Generation (RAG) application using LlamaIndex on Google Cloud Axion Arm64. + +You'll: + +- Create sample documents +- Build a LlamaIndex RAG engine +- Store embeddings in ChromaDB +- Create a browser UI +- Create a FastAPI backend +- Query documents directly from a web browser + +## Terminal usage + +You'll use: + +- **Terminal A** → FastAPI, file creation, and testing +- **Terminal B** → Ollama server + +Leave Terminal B running throughout the rest of this Learning Path. + +## Architecture + +```text +Browser UI + ↓ +FastAPI + ↓ +LlamaIndex + ↓ +ChromaDB Vector Store + ↓ +Ollama Local LLM + ↓ +Documents +```` + +## Activate the Python environment + +Open Terminal A and activate the Python virtual environment: + +```bash +cd ~/llamaindex-rag +source rag-env/bin/activate +``` + +## Create sample documents + +Create the first document: + +```bash +cat > data/arm_cloud.txt <<'EOF' +Google Cloud Axion is a family of Arm-based processors optimized for AI, cloud-native workloads, and scalable infrastructure. +EOF +``` + +Create the second document: + +```bash +cat > data/rag.txt <<'EOF' +Retrieval-Augmented Generation combines vector search and large language models to generate grounded responses from custom data. +EOF +``` + +Create the third document: + +```bash +cat > data/llamaindex.txt <<'EOF' +LlamaIndex is a framework for building context-aware LLM applications using indexing, retrieval, query engines, and vector databases. +EOF +``` + +## Create the RAG engine + +Create the main LlamaIndex application: + +```bash +cat > rag_app.py <<'EOF' +import chromadb + +from llama_index.core import ( + VectorStoreIndex, + SimpleDirectoryReader, + StorageContext, + Settings +) + +from llama_index.core.node_parser import SentenceSplitter +from llama_index.llms.ollama import Ollama +from llama_index.embeddings.huggingface import HuggingFaceEmbedding +from llama_index.vector_stores.chroma import ChromaVectorStore + + +DATA_DIR = "./data" +CHROMA_DIR = "./chroma_db" +COLLECTION_NAME = "llamaindex_demo" + + +def build_query_engine(): + + llm = Ollama( + model="llama3.2:1b", + request_timeout=120.0 + ) + + embed_model = HuggingFaceEmbedding( + model_name="BAAI/bge-small-en-v1.5" + ) + + Settings.llm = llm + Settings.embed_model = embed_model + + Settings.node_parser = SentenceSplitter( + chunk_size=512, + chunk_overlap=50 + ) + + documents = SimpleDirectoryReader( + DATA_DIR + ).load_data() + + chroma_client = chromadb.PersistentClient( + path=CHROMA_DIR + ) + + chroma_collection = chroma_client.get_or_create_collection( + COLLECTION_NAME + ) + + vector_store = ChromaVectorStore( + chroma_collection=chroma_collection + ) + + storage_context = StorageContext.from_defaults( + vector_store=vector_store + ) + + index = VectorStoreIndex.from_documents( + documents, + storage_context=storage_context + ) + + query_engine = index.as_query_engine( + similarity_top_k=3, + response_mode="compact" + ) + + return query_engine +EOF +``` + +## Create browser UI + +Create a browser-based interface for asking questions: + +```bash +cat > index.html <<'EOF' + + + + LlamaIndex Browser RAG + + + + + + +
+ +

LlamaIndex Browser-Based RAG

+ + + +
+ + + +

Answer:

+ +
+ Your answer will appear here. +
+ +
+ + + + + +EOF +``` + +## Create FastAPI backend + +Create the FastAPI backend application: + +```bash +cat > api.py <<'EOF' +from fastapi import FastAPI +from fastapi.responses import FileResponse +from pydantic import BaseModel + +from rag_app import build_query_engine + + +app = FastAPI( + title="LlamaIndex Browser RAG" +) + +query_engine = build_query_engine() + + +class QueryRequest(BaseModel): + question: str + + +@app.get("/") +def home(): + return FileResponse("index.html") + + +@app.post("/query") +def query_rag(request: QueryRequest): + + response = query_engine.query( + request.question + ) + + return { + "question": request.question, + "answer": str(response) + } +EOF +``` + +## Start the browser-based RAG application + +Make sure Ollama is still running in Terminal B. + +In Terminal A run: + +```bash +cd ~/llamaindex-rag +source rag-env/bin/activate +``` + +Start FastAPI: + +```bash +uvicorn api:app --host 0.0.0.0 --port 8000 +``` + +The output is similar to: + +```output +INFO: Started server process [18452] +INFO: Waiting for application startup. +INFO: Application startup complete. +INFO: Uvicorn running on http://0.0.0.0:8000 +``` + + +## Open browser application + +Open a browser and navigate to: + +```text +http://:8000 +``` + +This opens the browser-based RAG application UI. + +![Browser-based RAG application showing a question input box and generated response using LlamaIndex and Ollama#center](images/rag-browser.png "Browser-based LlamaIndex RAG application") + +## Test browser-based Q&A + +Ask the following questions in the browser UI: + +```text +What is RAG? +``` + +![Browser UI showing the response generated for the question 'What is RAG?' using LlamaIndex and Ollama#center](images/rag-question-1.png "RAG question response") + +```text +What is LlamaIndex? +``` + +![Browser UI showing the response generated for the question 'What is LlamaIndex?'#center](images/rag-question-2.png "LlamaIndex question response") + +```text +What is Google Cloud Axion? +``` + +![Browser UI showing the response generated for the question 'What is Google Cloud Axion?'#center](images/rag-question-3.png "Google Cloud Axion question response") + +The answers will appear directly in the browser interface. + +## Add your own documents + +Copy your own files into the data directory: + +```bash +cp yourfile.txt ~/llamaindex-rag/data/ +``` + +Restart FastAPI: + +```bash +uvicorn api:app --host 0.0.0.0 --port 8000 +``` + +The application automatically indexes the new documents and makes them searchable through the browser UI. + +## What you've accomplished + +You've successfully built a browser-based RAG application using LlamaIndex on a Google Cloud Axion Arm64 VM. You created sample documents, generated embeddings using HuggingFace models, stored vectors in ChromaDB, exposed the backend using FastAPI, and queried custom documents directly from a browser using Ollama. diff --git a/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/firewall.md b/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/firewall.md new file mode 100644 index 0000000000..9934633d45 --- /dev/null +++ b/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/firewall.md @@ -0,0 +1,49 @@ +--- +title: Configure Google Cloud firewall rules for LlamaIndex +weight: 3 + +### FIXED, DO NOT MODIFY +layout: learningpathall +--- + +## Allow inbound access to the LlamaIndex browser application + +Create a firewall rule in Google Cloud Console to expose the required port for the browser-based LlamaIndex RAG application. + +{{% notice Note %}}For help with GCP setup, see the Learning Path [Getting started with Google Cloud Platform](/learning-paths/servers-and-cloud-computing/csp/google/).{{% /notice %}} + +## Configure the firewall rule in Google Cloud Console + +To configure a firewall rule for the LlamaIndex browser-based RAG application: + +1. Navigate to the [Google Cloud Console](https://console.cloud.google.com/), go to **VPC Network > Firewall**, and select **Create firewall rule**. + +![Google Cloud Console VPC Network Firewall page showing the Create firewall rule button in the top menu bar#center](images/firewall-rule.png "Create a firewall rule in Google Cloud Console") + +2. Create a firewall rule that exposes the port required for the LlamaIndex browser application. + +3. Set **Name** to `allow-llamaindex-port`, then select the network you want to bind to your virtual machine. + +4. Set **Direction of traffic** to **Ingress**, set **Action on match** to **Allow**, set **Targets** to **All instances in the network**, and set **Source IPv4 ranges** to **0.0.0.0/0**. + +![Google Cloud Console Create firewall rule form with Name set to allow-llamaindex-port and Direction of traffic set to Ingress#center](images/network-rule.png "Configuring the allow-llamaindex-port firewall rule") + +5. Under **Protocols and ports**, select **Specified protocols and ports**. + +6. Select the **TCP** checkbox and enter: + +```text +8000 +```` + +Use port mapping **8000** for the browser-based LlamaIndex RAG application running with FastAPI. + +![Google Cloud Console Protocols and ports section with TCP selected and port 8000 entered#center](images/network-port.png "Setting the LlamaIndex browser application port in the firewall rule") + +7. Select **Create**. + +## What you've accomplished and what's next + +You've created a firewall rule to expose the browser-based LlamaIndex RAG application. You also enabled external access to query documents and interact with the application directly from a web browser. + +Next, you'll access the browser-based RAG application using the external IP address of your Google Cloud Axion virtual machine. diff --git a/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/images/firewall-rule.png b/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/images/firewall-rule.png new file mode 100644 index 0000000000..ab99314834 Binary files /dev/null and b/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/images/firewall-rule.png differ diff --git a/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/images/gcp-pubip-ssh.png b/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/images/gcp-pubip-ssh.png new file mode 100644 index 0000000000..558745de3e Binary files /dev/null and b/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/images/gcp-pubip-ssh.png differ diff --git a/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/images/gcp-shell.png b/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/images/gcp-shell.png new file mode 100644 index 0000000000..7e2fc3d1b5 Binary files /dev/null and b/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/images/gcp-shell.png differ diff --git a/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/images/gcp-vm.png b/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/images/gcp-vm.png new file mode 100644 index 0000000000..0d1072e20d Binary files /dev/null and b/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/images/gcp-vm.png differ diff --git a/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/images/network-port.png b/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/images/network-port.png new file mode 100644 index 0000000000..9a7b2be3bd Binary files /dev/null and b/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/images/network-port.png differ diff --git a/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/images/network-rule.png b/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/images/network-rule.png new file mode 100644 index 0000000000..1072219e39 Binary files /dev/null and b/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/images/network-rule.png differ diff --git a/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/images/rag-browser.png b/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/images/rag-browser.png new file mode 100644 index 0000000000..95096b958a Binary files /dev/null and b/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/images/rag-browser.png differ diff --git a/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/images/rag-question-1.png b/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/images/rag-question-1.png new file mode 100644 index 0000000000..008aa390bf Binary files /dev/null and b/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/images/rag-question-1.png differ diff --git a/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/images/rag-question-2.png b/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/images/rag-question-2.png new file mode 100644 index 0000000000..feb34435ff Binary files /dev/null and b/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/images/rag-question-2.png differ diff --git a/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/images/rag-question-3.png b/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/images/rag-question-3.png new file mode 100644 index 0000000000..2ed4b476cc Binary files /dev/null and b/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/images/rag-question-3.png differ diff --git a/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/instance.md b/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/instance.md new file mode 100644 index 0000000000..32944d0c5a --- /dev/null +++ b/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/instance.md @@ -0,0 +1,45 @@ +--- +title: Create a Google Axion C4A virtual machine for LlamaIndex +weight: 4 + +### FIXED, DO NOT MODIFY +layout: learningpathall +--- + +## Set up the virtual machine + +In this section, you'll create a Google Axion C4A Arm-based virtual machine (VM) on Google Cloud Platform (GCP). You'll use the `c4a-standard-4` machine type, which provides 4 vCPUs and 16 GB of memory. This VM will host your browser-based LlamaIndex RAG application. + +{{% notice Note %}}For help with GCP setup, see the Learning Path [Getting started with Google Cloud Platform](/learning-paths/servers-and-cloud-computing/csp/google/).{{% /notice %}} + +## Configure the C4A virtual machine in Google Cloud Console + +To create a virtual machine based on the C4A instance type in the console: + +1. Navigate to the [Google Cloud Console](https://console.cloud.google.com/). +2. Go to **Compute Engine** > **VM Instances** and select **Create Instance**. +3. Under **Machine configuration**, populate fields such as **Instance name**, **Region**, and **Zone**. +4. Set **Series** to `C4A`, then select `c4a-standard-4` for **Machine type**. + +![Screenshot of the Google Cloud Console showing the Machine configuration section. The Series dropdown is set to C4A and the machine type c4a-standard-4 is selected#center](images/gcp-vm.png "Configuring machine type to C4A in Google Cloud Console") + +5. Under **OS and storage**, select **Change** and then choose an Arm64-based operating system image. For this Learning Path, select **SUSE Linux Enterprise Server**. +6. For the license type, choose **Pay as you go**. +7. Increase **Size (GB)** from **10** to **100** to allocate sufficient disk space, and then select **Choose**. +8. Expand **Advanced options** and select **Networking**. +9. Under **Network tags**, enter `allow-llamaindex-port` to link the VM to the firewall rule from the previous step and allow inbound access to port 8000 for the browser-based LlamaIndex RAG application. +10. Select **Create** to launch the virtual machine. + +After the instance starts, select **SSH** next to the VM in the instance list to open a browser-based terminal session. + +![Google Cloud Console VM instances page displaying running instance with green checkmark and SSH button in the Connect column#center](images/gcp-pubip-ssh.png "Connecting to a running C4A VM using SSH") + +A new browser window opens with a terminal connected to your VM. + +![Browser-based SSH terminal connected to the Google Axion C4A VM. The shell prompt confirms that the instance is running and ready for the next step, where you'll install LlamaIndex and its dependencies.#center](images/gcp-shell.png "Terminal session connected to the VM") + +## What you've accomplished and what's next + +You've now provisioned a Google Axion C4A Arm VM and connected to it using SSH. + +Next, you'll install LlamaIndex, Ollama, ChromaDB, and the required dependencies on your VM. diff --git a/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/setup-llamaindex-rag.md b/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/setup-llamaindex-rag.md new file mode 100644 index 0000000000..ed6033c5b1 --- /dev/null +++ b/content/learning-paths/servers-and-cloud-computing/llmaidex-rag-axion/setup-llamaindex-rag.md @@ -0,0 +1,228 @@ +--- +title: Install and Configure LlamaIndex on Google Cloud Axion +weight: 5 + +### FIXED, DO NOT MODIFY +layout: learningpathall +--- + +## Install and Configure LlamaIndex on Google Cloud Axion + +In this section, you will prepare a Google Cloud Axion Arm64 VM for running a browser-based RAG application using LlamaIndex. + +You will: + +- Verify the VM architecture +- Install required system packages +- Install Docker +- Install Python 3.11 +- Install Ollama +- Pull a lightweight LLM model +- Install LlamaIndex and required Python packages + + +## Target environment + +```text +Cloud: Google Cloud Platform +VM Type: C4A Axion ARM64 +OS: SUSE Linux Enterprise Server 15 SP6 +Architecture: aarch64 +RAM: 16 GB or higher recommended +``` + +## Terminal usage You'll use + +- **Terminal A** → setup, package installation, FastAPI, and testing +- **Terminal B** → Ollama server Open both terminals connected to the VM before starting. + +## Verify VM architecture + +```bash +uname -m +cat /etc/os-release +``` + +The output is similar to: + +```output +aarch64 +NAME="SLES" +VERSION="15-SP5" +VERSION_ID="15.5" +PRETTY_NAME="SUSE Linux Enterprise Server 15 SP5" +ID="sles" +ID_LIKE="suse" +ANSI_COLOR="0;32" +CPE_NAME="cpe:/o:suse:sles:15:sp5" +DOCUMENTATION_URL="https://documentation.suse.com/" +``` + +This confirms you are on an Arm-based VM. + +## Update the VM +Update all system packages: + +```bash +sudo zypper refresh +sudo zypper update -y +``` + +This ensures your system is up to date before installing anything. + +## Install required packages: +Now install Python 3.11 and other tools: + +```bash +sudo zypper install -y \ +git \ +curl \ +wget \ +tar \ +gzip \ +gcc \ +gcc-c++ \ +make \ +cmake \ +sqlite3 \ +python311 \ +python311-pip \ +python311-devel \ +python311-setuptools \ +python311-wheel +``` + +**Verify Python:** + +```bash +python3.11 --version +``` + +The output is similar to: + +```output +Python 3.11.10 +pip 22.3.1 from /usr/lib/python3.11/site-packages/pip (python 3.11) +``` + +## Install Docker and Add current user to Docker group + +```bash +sudo zypper install -y docker +sudo systemctl enable docker +sudo systemctl start docker +``` + +**Check Docker Add current user to Docker group:** + +```bash +sudo systemctl status docker +sudo usermod -aG docker $USER +newgrp docker +``` + +**Test Docker:** + +```bash +docker run hello-world +``` + +The output is similar to: + +```output +Hello from Docker! +This message shows that your installation appears to be working correctly. +``` + +## Create project directory + +```bash +mkdir -p ~/llamaindex-rag/data +cd ~/llamaindex-rag +``` + +**Create and Activate Python virtual environment:** + +```bash +python3.11 -m venv rag-env +source rag-env/bin/activate +``` + +**Upgrade pip:** + +```bash +pip install --upgrade pip setuptools wheel +``` + +## Install Ollama + +```bash +curl -fsSL https://ollama.com/install.sh | sh +``` + +**Verify:** + +```bash +ollama -v +``` + +The output is similar to: + +```output +ollama version is 0.24.0 +``` + +## Start Ollama + +```bash +ollama serve +``` + +Leave Terminal B open and don't run any other commands in it. Ollama must stay running throughout the rest of this Learning Path. + +## Open a new terminal + +Open a second SSH terminal and run: + +```bash +cd ~/llamaindex-rag +source rag-env/bin/activate +``` + +## Pull an LLM model + +```bash +ollama pull llama3.2:1b +``` + +**Test the model:** + +```bash +ollama run llama3.2:1b "Explain RAG in one sentence." +``` + +The output is similar to: + +```output +RAG (Resource Allocation Group) is a method of allocating resources, such as people or equipment, to tasks based on their criticality and urgency, +prioritizing high-priority tasks that have significant consequences if not completed on time. +``` + +## Install LlamaIndex packages + +```bash +pip install llama-index +pip install llama-index-llms-ollama +pip install llama-index-embeddings-huggingface +pip install llama-index-vector-stores-chroma +pip install chromadb +pip install sentence-transformers +pip install fastapi +pip install uvicorn +``` + +## What you've accomplished and what's next + +You've successfully installed and configured LlamaIndex on a Google Cloud Axion Arm64 VM running SUSE Linux with Python 3.11. You installed Docker, configured Ollama for local LLM inference, and prepared the environment for building browser-based RAG applications using LlamaIndex and ChromaDB. + +Next, you'll build the RAG engine, create the browser UI, and query custom documents using a local large language model.