---
title: "Gemini A2A Bridge Setup"
description: "Documentation on setting up an Agent-to-Agent bridge to offload Gemini CLI tasks to a local Ollama instance."
author: wompmacho
date: 2026-04-12T12:00:00-04:00
lastmod: 2026-04-12
tags:
- gemma4
- ai
- gemini-cli
- ollama
---

# Gemini CLI Local A2A Setup

Setting up an Agent-to-Agent (A2A) bridge allows Gemini CLI to delegate computationally expensive tasks to a local GPU, significantly reducing API token consumption while leveraging high-performance local hardware.

## Goal

The primary objective is to offload heavy lifting, such as complex code generation and deep architectural analysis, to a local RTX 4080 GPU located at `10.0.0.109`. By routing these requests through a local instance of Ollama, we maintain high inference speed for large models without incurring external API costs.

## Bridge Script

A Node.js bridge script acts as the intermediary between Gemini CLI and Ollama. This script is located at `/home/wompmacho/a2a-ollama-bridge.js` and runs on `localhost:8080`. It performs the following functions:

1.  **Agent Card Hosting:** Serves the required `agent.json` metadata at `/.well-known/agent.json` so Gemini CLI can discover the sub-agent's capabilities.
2.  **Request Translation:** Receives task payloads from Gemini CLI, extracts the prompt, and forwards it to the Ollama API.
3.  **Response Handling:** Captures the local model's output and returns it to Gemini CLI in the expected A2A format.

## Sub-agent Configuration

The sub-agent is integrated into Gemini CLI via a configuration file located at `/home/wompmacho/.gemini/agents/local-gemma.md`. This file defines the sub-agent as a `remote` kind and points to the bridge's metadata endpoint:

```yaml
---
kind: remote
name: local-gemma
description: "A powerful local sub-agent running Gemma 26B on an RTX 4080."
agent_card_url: http://127.0.0.1:8080/.well-known/agent.json
---
```

## Model Details

The bridge is configured to utilize the **gemma4:26b** model. This 26-billion parameter model is optimized for the local RTX 4080, providing a balance of reasoning capability and performance that rivals many cloud-based alternatives for specialized technical tasks.
