lightweight go reverse proxy for ollama with bearer token authentication
go proxy ollama
Go 77.6%
Makefile 7.1%
Other 15.3%
10 1 1

Clone this repository

https://tangled.org/julien.rbrt.fr/ollama-proxy
git@knot.srv.rbrt.fr:julien.rbrt.fr/ollama-proxy

For self-hosted knots, clone URLs may differ based on your setup.

readme.md

Ollama Proxy#

A lightweight Go reverse proxy for Ollama with Bearer token authentication.

Features#

  • Simple reverse proxy to Ollama API
  • Bearer token authentication
  • Easy configuration via environment variables

Installation#

go install pkg.rbrt.fr/ollama-proxy@latest
go build -o ollama-proxy

Configuration#

The proxy is configured via environment variables:

  • OP_AUTH_TOKEN (required): Bearer token for API authentication
  • OP_OLLAMA_URL (optional): Ollama server URL (default: http://localhost:11434)
  • OP_PORT (optional): Proxy server port (default: 11433)

Usage#

Start the proxy#

export OP_AUTH_TOKEN="your-secret-token"
export OP_OLLAMA_URL="http://localhost:11434"
export OP_PORT="11433"
ollama-proxy