optillm is a free, open source api development & testing project written in Python and released under Apache-2.0. It has 4,280 GitHub stars, 388 forks and 23 open issues, and was last pushed 17 hours ago. On this registry it ranks #54 of 103 tracked projects in API Development & Testing, with 5 head-to-head comparisons available. It gained 17 stars over the last 3 tracked days.

What is optillm?

What it is

OptiLLM is a Python project that provides an optimizing inference proxy for large language models. It exposes an OpenAI API-compatible endpoint and sits between an application and model providers, allowing callers to request reasoning-oriented optimizations without changing model weights or adding training. The project lives in the developer tools and API development ecosystem, and its topics connect it to agents, agentic workflows, API gateways, chain-of-thought prompting, and generative AI inference.

The concrete problem it addresses is that direct calls to language models can produce weak answers on math, coding, and logical reasoning tasks, while fine-tuning or replacing a model may be impractical. OptiLLM attempts to improve answer quality by applying inference-time techniques, such as best-of-N sampling, mixture of agents, planning, search, and Monte Carlo tree search, so that a smaller or cheaper model can be used with additional compute at request time. It is distributed under the Apache-2.0 license.

Key capabilities

  • OptiLLM implements more than twenty inference optimization techniques, including best-of-N, mixture of agents, planning, search, and Monte Carlo tree search.
  • It accepts requests through an OpenAI-compatible interface, so existing clients can call a local proxy base URL instead of a provider endpoint.
  • It supports multiple providers and models through LiteLLM, including OpenAI, Anthropic, Google, Cerebras, and more than one hundred models.
  • It provides Docker images for full operation, proxy-only operation, and offline operation with pre-downloaded spaCy models.
  • It includes plugin loading, with examples shown for privacy and memory plugins, and can start with automatic approach selection.

Who uses it and how

  • Developers can run the proxy locally and point an existing OpenAI client to localhost port 8000 to test reasoning improvements on coding, math, and logic prompts.
  • Teams that already use OpenAI-compatible endpoints can keep client code mostly unchanged and select an optimization prefix to request a different inference strategy.
  • Self-hosters can choose a lightweight proxy-only Docker image when local inference is not needed, or an offline image when they need a self-contained container.

Getting started

Typical installation uses the pip install optillm command, then setting an OpenAI API key and running optillm to start a local server on port 8000. Docker deployment uses ghcr.io/algorithmicsuperintelligence/optillm with latest, latest-proxy, and latest-offline variants, and the README also points to a HuggingFace Space and a Colab demo.

When to use it — and when not to

OptiLLM is useful when a team wants inference-time reasoning improvements without training, and when it can accept extra compute, latency, and cost. It is less suitable when an application needs a minimal dependency chain, because self-hosting requires operating the proxy, managing provider API keys, and selecting Docker image variants. The README excerpt does not describe a managed hosted service.

project readme (upstream, from github) — read inline

OptiLLM

🚀 2-10x accuracy improvements on reasoning tasks with zero training

PyPI version PyPI Downloads License

🤗 HuggingFace Space📓 Colab Demo💬 Discussions


OptiLLM is an OpenAI API-compatible optimizing inference proxy that implements 20+ state-of-the-art techniques to dramatically improve LLM accuracy and performance on reasoning tasks - without requiring any model training or fine-tuning.

It is possible to beat the frontier models using these techniques across diverse tasks by doing additional compute at inference time. A good example of how to combine such techniques together is the CePO approach from Cerebras.

✨ Key Features

  • 🎯 Instant Improvements: 2-10x better accuracy on math, coding, and logical reasoning
  • 🔌 Drop-in Replacement: Works with any OpenAI-compatible API endpoint
  • 🧠 20+ Optimization Techniques: From simple best-of-N to advanced MCTS and planning
  • 📦 Zero Training Required: Just proxy your existing API calls through OptiLLM
  • ⚡ Production Ready: Used in production by companies and researchers worldwide
  • 🌍 Multi-Provider: Supports OpenAI, Anthropic, Google, Cerebras, and 100+ models via LiteLLM

🚀 Quick Start

Get powerful reasoning improvements in 3 simple steps:

# 1. Install OptiLLM
pip install optillm

# 2. Start the server
export OPENAI_API_KEY="your-key-here"
optillm

# 3. Use with any OpenAI client - just change the model name!
from openai import OpenAI

client = OpenAI(base_url="http://localhost:8000/v1")

# Add 'moa-' prefix for Mixture of Agents optimization
response = client.chat.completions.create(
    model="moa-gpt-4o-mini",  # This gives you GPT-4o performance from GPT-4o-mini!
    messages=[{"role": "user", "content": "Solve: If 2x + 3 = 7, what is x?"}]
)

Before OptiLLM: "x = 1" ❌
After OptiLLM: "Let me work through this step by step: 2x + 3 = 7, so 2x = 4, therefore x = 2" ✅

📊 Proven Results

OptiLLM delivers measurable improvements across diverse benchmarks:

Technique Base Model Improvement Benchmark
MARS Gemini 2.5 Flash Lite +30.0 points AIME 2025 (43.3→73.3)
CePO Llama 3.3 70B +18.6 points Math-L5 (51.0→69.6)
AutoThink DeepSeek-R1-1.5B +9.34 points GPQA-Diamond (21.72→31.06)
LongCePO Llama 3.3 70B +13.6 points InfiniteBench (58.0→71.6)
MOA GPT-4o-mini Matches GPT-4 Arena-Hard-Auto
PlanSearch GPT-4o-mini +20% pass@5 LiveCodeBench

Full benchmark results below ⬇️

🏗️ Installation

Using pip

pip install optillm
optillm
2024-10-22 07:45:05,612 - INFO - Loaded plugin: privacy
2024-10-22 07:45:06,293 - INFO - Loaded plugin: memory
2024-10-22 07:45:06,293 - INFO - Starting server with approach: auto

Using docker

docker pull ghcr.io/algorithmicsuperintelligence/optillm:latest
docker run -p 8000:8000 ghcr.io/algorithmicsuperintelligence/optillm:latest
2024-10-22 07:45:05,612 - INFO - Loaded plugin: privacy
2024-10-22 07:45:06,293 - INFO - Loaded plugin: memory
2024-10-22 07:45:06,293 - INFO - Starting server with approach: auto

Available Docker image variants:

  • Full image (latest): Includes all dependencies for local inference and plugins
  • Proxy-only (latest-proxy): Lightweight image without local inference capabilities
  • Offline (latest-offline): Self-contained image with pre-downloaded models (spaCy) for fully offline operation
# Proxy-only (smallest)
docker pull ghcr.io/algorithmicsuperintelligence/optillm:latest-proxy

# Offline (largest, includes pre-downloaded models)
docker pull ghcr.io/algorithmicsuperintelligence/optillm:latest-offline

Install from source

Clone the repository with git and use pip install to setup the dependencies.

git clone https://github.com/algorithmicsuperintelligence/optillm.git
cd optillm
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

🔒 SSL Configuration

OptILLM supports SSL certificate verification configuration for working with self-signed certificates or corporate proxies.

Disable SSL verification (development only):

# Command line
optillm --no-ssl-verify

# Environment variable
export OPTILLM_SSL_VERIFY=false
optillm

Use custom CA certificate:

# Command line
optillm --ssl-cert-path /path/to/ca-bundle.crt

# Environment variable
export OPTILLM_SSL_CERT_PATH=/path/to/ca-bundle.crt
optillm

⚠️ Security Note: Disabling SSL verification is insecure and should only be used in development. For production environments with custom CAs, use --ssl-cert-path instead. See SSL_CONFIGURATION.md for details.

Implemented techniques

Approach Slug Description
MARS (Multi-Agent Reasoning System) mars Multi-agent reasoning with diverse temperature exploration, cross-verification, and iterative improvement
Cerebras Planning and Optimization cepo Combines Best of N, Chain-of-Thought, Self-Reflection, Self-Improvement, and various prompting techniques
CoT with Reflection cot_reflection Implements chain-of-thought reasoning with , \ and \ sections
PlanSearch plansearch Implements a search algorithm over candidate plans for solving a problem in natural language
ReRead re2 Implements rereading to improve reasoning by processing queries twice
Self-Consistency self_consistency Implements an advanced self-consistency method
Z3 Solver z3 Utilizes the Z3 theorem prover for logical reasoning
R* Algorithm rstar Implements the R* algorithm for problem-solving
LEAP leap Learns task-specific principles from few shot examples
Round Trip Optimization rto Optimizes responses through a round-trip process
Best of N Sampling bon Generates multiple responses and selects the best one
Mixture of Agents moa Combines responses from multiple critiques
Monte Carlo Tree Search mcts Uses MCTS for decision-making in chat responses
PV Game pvg Applies a prover-verifier game approach at inference time
Deep Confidence N/A for proxy Implements confidence-guided reasoning with multiple intensity levels for enhanced accuracy
CoT Decoding N/A for proxy Implements chain-of-thought decoding to elicit reasoning without explicit prompting
Entropy Decoding N/A for proxy Implements adaptive sampling based on the uncertainty of tokens during generation
Thinkdeeper N/A for proxy Implements the `

readme truncated — read the full docs on github

Frequently asked questions

Is optillm free to use?

optillm is open source under the Apache-2.0 licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does optillm do?

Optimizing inference proxy for LLMs

What is optillm written in?

optillm is primarily written in Python. Its source is publicly available at https://github.com/algorithmicsuperintelligence/optillm, and it has 4,280 GitHub stars.