Skip to content

Repository files navigation

Ollamaduct Logo

Ollamaduct

npm version npm downloads License

A lightweight, local-first AI gateway for Ollama with workspaces, usage analytics, and privacy controls.

Overview

Ollamaduct is an open-source gateway designed to sit between your local apps and Ollama. It adds a layer of intelligence to your LLM setup, handling the heavy lifting like managing access, tracking usage, and speeding up responses with smart caching while ensuring sensitive data stays under your control.

Note

Ollamaduct is currently CLI-only. A web-based interface and MCP server support are planned for future releases to improve the overall experience. Contributions and feedback are welcome!

Installation

Prerequisites

Quick Install

# Using npm
npm install -g @ollamaduct/gateway

# Using bun
bun install -g @ollamaduct/gateway

Verify Installation

ollamaduct --version

Configuration

First-Time Setup

ollamaduct init

This creates the configuration file at ~/.ollamaduct/config.env (Linux/Mac) or %APPDATA%/ollamaduct/config.env (Windows).

Configuration File

Edit the config file to customize your gateway:

# Ollama Settings
OLLAMA_URL=https://ollama.com
OLLAMA_API_KEY=your_ollama_api_key

# Security - REQUIRED for production
API_KEY=your-secure-gateway-api-key

# Default model
DEFAULT_MODEL=llama2
Variable Description Default
OLLAMA_URL Ollama endpoint URL http://localhost:11434
OLLAMA_API_KEY API key for Ollama Cloud -
API_KEY Gateway authentication key (not set - insecure)
DEFAULT_MODEL Default model to use llama2

Quick Start

# Start the gateway server
ollamaduct start

# Or start on custom port
ollamaduct start --port 8080

# Check server status
ollamaduct status

# Stop the server
ollamaduct stop

Usage Examples

# List available models
ollamaduct models

# Manage API keys
ollamaduct keys
ollamaduct keys --create

# View usage logs
ollamaduct logs
ollamaduct logs --limit 50

# View statistics
ollamaduct stats

# Manage workspaces
ollamaduct workspaces
ollamaduct workspaces --create "My Project"

# Manage cache
ollamaduct cache
ollamaduct cache --clear

Upgrade

To upgrade to the latest version:

# Using npm
npm install -g @ollamaduct/gateway

# Using bun
bun install -g @ollamaduct/gateway

Check current version:

ollamaduct --version

Features

  • Workspaces - Organize projects and track usage separately per workspace
  • Ollama Integration - Native Ollama gateway with local and cloud model support
  • Authentication & API Keys - Secure API key-based authentication per workspace
  • Usage Analytics - Real-time usage tracking and analytics by workspace
  • Semantic Caching - Vector-based intelligent caching with 95%+ similarity detection
  • Privacy Shield - Enterprise-grade PII detection and redaction with 25+ entity types

Use Cases

  • Production AI Applications - Add authentication, usage tracking, and caching to your AI features
  • Privacy-Sensitive Workloads - Keep data on-premise with local Ollama deployment
  • Performance Optimization - Cache frequent queries and speed up responses
  • Local AI Gateway - Secure gateway for self-hosted Ollama instances
  • Compliance - Automatically redact PII before sending to LLM providers

Documentation

License

MIT License - see LICENSE for details.

Disclaimer

Ollamaduct is an independent project and is not affiliated with the official Ollama project.

About

A lightweight, local-first AI gateway for Ollama with workspaces, cost tracking, PII redaction, and intelligent caching.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages