Skip to content

Home

A modern, high-performance proxy server that translates Ollama API calls to OpenRouter, enabling seamless access to a wide variety of AI models through the familiar Ollama interface.

PyPI License Python Version


Overview

Ollama Proxy acts as a bridge between any Ollama-compatible client and the OpenRouter API. This allows you to use your favorite tools and applications that support Ollama with the extensive range of models offered by OpenRouter, without needing to modify your client-side code.

Features

  • 🔄 Seamless Translation: Converts Ollama API calls to the OpenRouter format.
  • 🚀 High Performance: Built with modern Python and asyncio for speed.
  • ⚙️ Flexible Configuration: Configure via environment variables, .env files, or CLI arguments.
  • 🔍 Model Filtering: Control which OpenRouter models are exposed.
  • 📊 Structured Logging: JSON logs for better observability.
  • 🐳 Docker Support: Easy to deploy with Docker and Docker Compose.

Quick Start

Prerequisites

Installation

  1. Clone the repository:

    git clone https://github.com/AstroAir/ollama-proxy.git
    cd ollama-proxy
    
  2. Install dependencies:

    pip install -e .
    
  3. Configure your API key: Create a .env file and add your key:

    OPENROUTER_API_KEY="your_openrouter_api_key_here"
    
  4. Run the server:

    ollama-proxy
    

Once the server is running, you can configure your Ollama client to point to http://localhost:11434 (or your custom host and port).

Documentation

Explore our comprehensive documentation to learn more about configuring and using the Ollama Proxy:

Core Documentation

Advanced Features

Contributing

Contributions are welcome! Please see the Contributing Guide for details on how to contribute to the project.

License

This project is licensed under the MIT License. See the LICENSE file for details.