Llama-Bridge

Llama-Bridge

MCP server that enables cloud models (like Gemini/Claude) to delegate coding tasks to a local llama.cpp server, preserving cloud usage limits through an AI-powered code review loop.

Category
Visit Server

README

Llama-Bridge — Local LLM Delegation Server

An MCP server that lets your cloud model (Gemini / Claude) delegate implementation work to a local llama.cpp server, preserving precious cloud-model usage limits while maintaining high code quality through AI-powered code review.

Cloud Model → Plans & Reviews
     ↕ MCP
Local Model → Writes Code

Quick Start

1. Prerequisites

  • Python 3.11+
  • uv (recommended) or pip
  • A running llama.cpp server (see below)

2. Start your local llama.cpp server

# Example with llama-server
./llama-server -m your-model.gguf --port 8080

# Or with llama-cpp-python
pip install llama-cpp-python[server]
python -m llama_cpp.server --model your-model.gguf --port 8080

3. Run the Automated Installer

We provide an automated installer script that creates a virtual environment, installs the package and its dependencies, and automatically configures llama-bridge in your global Antigravity/Gemini configuration directory (~/.gemini/config/mcp_config.json on Linux/macOS):

python install.py

4. Configure Global Model Instructions (Required)

To enable the cloud model to automatically use the local Llama-Bridge delegation tools across all workspaces:

  1. Open the project-scoped [.agents/AGENTS.md](file://./.agents/AGENTS.md) file.
  2. Copy its entire content.
  3. Paste the content into your global GEMINI.md instructions file located at ~/.gemini/GEMINI.md.

5. Custom Configuration (Optional)

The installer will set the default local server URL to http://localhost:8080. If you need to customize this, or set a custom API key, you can add environment variables to the "env" block in your global mcp_config.json or create a .env file in the project directory:

# Example .env settings:
LLAMA_BASE_URL=http://localhost:8080
LLAMA_REQUEST_TIMEOUT=120

6. Verify

Restart Antigravity IDE. The cloud model should now have access to:

  • implement_code
  • generate_tests
  • refactor_code
  • fix_code
  • generate_docs
  • check_local_model_health

Available Tools

Tool Purpose Inputs
implement_code Generate implementation from a spec task_description, language, context, constraints
generate_tests Generate test code code, language, framework, requirements
refactor_code Apply a specific refactor code, language, refactor_description, constraints
fix_code Fix bugs from errors/feedback code, language, errors, review_comments
generate_docs Generate documentation code, language, style
check_local_model_health Check server availability (none)

Every code tool returns a consistent ToolResponse:

{
  "success": true,
  "code": "def hello(): ...",
  "error": null,
  "metadata": {
    "tool": "implement_code",
    "elapsed_seconds": 3.42,
    "usage": {"prompt_tokens": 150, "completion_tokens": 89},
    "warnings": []
  }
}

Configuration

All settings are configured via environment variables or a .env file:

Variable Default Description
LLAMA_BASE_URL http://localhost:8080 llama.cpp server URL
LLAMA_REQUEST_TIMEOUT 120 Timeout in seconds
LLAMA_DEFAULT_TEMPERATURE None (Uses server default) Default sampling temperature
LLAMA_DEFAULT_MAX_TOKENS 131072 Default token budget
LLAMA_MODEL_NAME local-model Model identifier (usually ignored)

Running Tests

uv run pytest tests/ -v

How It Works

The cloud model (Gemini/Claude in Antigravity IDE) acts as a senior engineer — it plans, delegates, and reviews. The local model acts as a fast junior engineer — it writes code quickly. The MCP server is the bridge between them.

  1. Cloud model receives a user request
  2. Cloud model breaks it into implementation tasks
  3. Cloud model calls MCP tools to delegate coding
  4. Local model generates implementation
  5. Cloud model reviews the code
  6. If issues found → calls fix_code with feedback
  7. Repeat until code meets quality standards
  8. Cloud model presents the final, reviewed code

This gives you practically unlimited coding capacity from the local model, with cloud-grade quality assurance from the review loop.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured