npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ollama-api-proxy

v1.0.4

Published

Multi-Provider Ollama Proxy Server for Node.js (OpenAI + Gemini + Openrouter). Free tier usage available.

Readme

Ollama to OpenAI/Gemini/OpenRouter Proxy

Version

A Multi-Provider Ollama Proxy Server that allows using JetBrains AI Assistant with third-party commercial LLMs like OpenAI, Google Gemini, and OpenRouter, taking advantage of their free tier usage. Especially for Kimi K2 and Deepseek R1

Overview

This proxy server translates requests from the Ollama API format to OpenAI, Google Gemini, or OpenRouter API formats, allowing you to use these commercial LLMs with tools that support the Ollama API, such as JetBrains AI Assistant.

The server runs on port 11434 by default (the same port as Ollama) and requires API keys for OpenAI, Gemini, and/or OpenRouter, configured via environment variables.

Features

  • Seamless integration with JetBrains AI Assistant
  • Support for multiple LLM providers:
    • OpenAI models
    • Google Gemini models
    • OpenRouter models
  • Compatible with Ollama API endpoints:
    • /api/chat - for chat completions
    • /api/generate - for text generation
    • /api/tags - for listing available models
    • /api/version - for version information

Supported Models

The proxy server supports a variety of models from OpenAI, Google Gemini, and OpenRouter. The default configurations are:

OpenAI Models

  • gpt-4o-mini
  • gpt-4.1-mini
  • gpt-4.1-nano

Google Gemini Models

  • gemini-2.5-flash
  • gemini-2.5-flash-lite-preview-06-17

OpenRouter Models

  • deepseek-r1

Customizing Models

You can customize the available models by creating a models.json file in the directory where you run the proxy server. This file should contain a JSON object where keys are the model names you want to expose, and values are objects specifying the provider (e.g., openai, google, openrouter) and the actual model name as expected by the respective API.

If a models.json file is found in the current working directory, the proxy will load models from it. Otherwise, it will use the built-in default models.

Example models.json:

{
    "my-custom-gpt": { "provider": "openai", "model": "gpt-4o-mini" },
    "my-gemini-pro": { "provider": "google", "model": "gemini-pro" },
    "my-openrouter-model": { "provider": "openrouter", "model": "mistralai/mistral-7b-instruct-v0.2" }
}

This allows you to rename models, add new ones supported by the providers, or remove models you don't intend to use.

Installation

Prerequisites

  • Node.js >= 18.0.0 or Bun >= 1.2.0
  • API key for OpenAI, Google Gemini, and/or OpenRouter

Using npm

# Clone the repository
git clone https://github.com/xrip/ollama-api-proxy.git
cd ollama-api-proxy

# Install dependencies
npm install

# Create .env file with your API keys
echo "OPENAI_API_KEY=your_openai_api_key" > .env
echo "GEMINI_API_KEY=your_gemini_api_key" >> .env
echo "OPENROUTER_API_KEY=your_openrouter_api_key" >> .env
echo "OPENROUTER_API_URL=your_openrouter_api_url" >> .env  # optional, default is https://openrouter.ai/api/v1

# Start the server
npm start

Using Docker

# Clone the repository
git clone https://github.com/xrip/ollama-api-proxy.git
cd ollama-api-proxy

# Create .env file with your API keys
echo "OPENAI_API_KEY=your_openai_api_key" > .env
echo "GEMINI_API_KEY=your_gemini_api_key" >> .env
echo "OPENROUTER_API_KEY=your_openrouter_api_key" >> .env
echo "OPENROUTER_API_URL=your_openrouter_api_url" >> .env  # optional, default is https://openrouter.ai/api/v1

# Build and run the Docker container
docker build -t ollama-proxy .
docker run -p 11434:11434 --env-file .env ollama-proxy

Using npx (Node.js)

# Create a directory for your configuration
mkdir ollama-proxy-config
cd ollama-proxy-config

# Create .env file with your API keys
echo "OPENAI_API_KEY=your_openai_api_key" > .env
echo "GEMINI_API_KEY=your_gemini_api_key" >> .env
echo "OPENROUTER_API_KEY=your_openrouter_api_key" >> .env
echo "OPENROUTER_API_URL=your_openrouter_api_url" >> .env  # optional, default is https://openrouter.ai/api/v1

# Run the proxy server using npx
npx ollama-api-proxy

# Alternatively, you can specify a specific version
# npx [email protected]

Using bunx (Bun)

# Create a directory for your configuration
mkdir ollama-proxy-config
cd ollama-proxy-config

# Create .env file with your API keys
echo "OPENAI_API_KEY=your_openai_api_key" > .env
echo "GEMINI_API_KEY=your_gemini_api_key" >> .env
echo "OPENROUTER_API_KEY=your_openrouter_api_key" >> .env
echo "OPENROUTER_API_URL=your_openrouter_api_url" >> .env  # optional, default is https://openrouter.ai/api/v1

# Run the proxy server using bunx
bunx ollama-api-proxy

# Alternatively, you can specify a specific version
# bunx [email protected]

Configuration

The proxy server is configured using environment variables:

  • PORT: The port on which the server will run (default: 11434)
  • OPENAI_API_KEY: Your OpenAI API key (required for OpenAI models)
  • GEMINI_API_KEY: Your Google Gemini API key (required for Gemini models)
  • OPENROUTER_API_KEY: Your OpenRouter API key (required for OpenRouter models)
  • OPENROUTER_API_URL: Your OpenRouter API URL (optional for OpenRouter models)
  • NODE_ENV: Set to production for production use or development for development

You can set these variables in a .env file in the project root.

Usage with JetBrains AI Assistant

  1. Start the Ollama Proxy server
  2. Configure JetBrains AI Assistant to use Ollama
  3. Set the Ollama server URL to http://localhost:11434
  4. Select one of the available models (e.g., gpt-4o, gemini-2.5-flash, deepseek-r1)

Development

# Run in development mode with hot reloading (requires Bun)
bun run dev

License

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