---
title: "optillm"
type: "tool"
slug: "algorithmicsuperintelligence-optillm"
canonical_url: "https://www.graphcanon.com/tools/algorithmicsuperintelligence-optillm"
github_url: "https://github.com/algorithmicsuperintelligence/optillm"
homepage_url: null
stars: 4170
forks: 368
primary_language: "Python"
license: "Apache-2.0"
categories: ["model-training", "inference-serving"]
tags: ["optimization", "proxy-server", "agentic-ai", "mixture-of-experts", "openai-api", "llm-inference", "prompt-engineering", "agent"]
updated_at: "2026-07-07T18:41:35.271466+00:00"
---

# optillm

> Optimizing inference proxy for LLMs

OptiLLM is an optimizing inference proxy compatible with OpenAI API, enhancing accuracy and performance on reasoning tasks without training.

## Facts

- Repository: https://github.com/algorithmicsuperintelligence/optillm
- Stars: 4,170 · Forks: 368 · Open issues: 21 · Watchers: 39
- Primary language: Python
- License: Apache-2.0
- Last pushed: 2026-07-05T05:41:35+00:00

## Categories

- [Model Training](/categories/model-training.md)
- [Inference & Serving](/categories/inference-serving.md)

## Tags

optimization, proxy-server, agentic-ai, mixture-of-experts, openai-api, llm-inference, prompt-engineering, agent

## Related tools

- [transformers](/tools/huggingface-transformers.md) - 🤗 Transformers: the model-definition framework for state-of-the-art machine learning models (★ 162,347)
- [open-webui](/tools/open-webui-open-webui.md) - User-friendly AI Interface (Supports Ollama, OpenAI API, ...) (★ 144,575)
- [LLMs-from-scratch](/tools/rasbt-llms-from-scratch.md) - Implement a ChatGPT-like LLM in PyTorch from scratch (★ 98,711)
- [vllm](/tools/vllm-project-vllm.md) - A high-throughput and memory-efficient inference and serving engine for LLMs (★ 85,612)
- [rtk](/tools/rtk-ai-rtk.md) - CLI proxy reducing LLM token consumption by 60-90% (★ 69,253)
- [unsloth](/tools/unslothai-unsloth.md) - Unsloth Studio is a web UI for training and running open models locally. (★ 67,883)
- [hello-agents](/tools/datawhalechina-hello-agents.md) - 《从零开始构建智能体》——从零开始的智能体原理与实践教程 (★ 64,659)
- [anything-llm](/tools/mintplex-labs-anything-llm.md) - Stop renting your intelligence. Own it with AnythingLLM. (★ 62,759)

## README (excerpt)

```text
# OptiLLM

<p align="center">
  <img src="optillm-logo.png" alt="OptiLLM Logo" width="400" />
</p>

<p align="center">
  <strong>🚀 2-10x accuracy improvements on reasoning tasks with zero training</strong>
</p>

<p align="center">
  <a href="https://github.com/algorithmicsuperintelligence/optillm/stargazers"><img src="https://img.shields.io/github/stars/algorithmicsuperintelligence/optillm?style=social" alt="GitHub stars"></a>
  <a href="https://pypi.org/project/optillm/"><img src="https://img.shields.io/pypi/v/optillm" alt="PyPI version"></a>
  <a href="https://pypi.org/project/optillm/"><img src="https://img.shields.io/pypi/dm/optillm" alt="PyPI downloads"></a>
  <a href="https://github.com/algorithmicsuperintelligence/optillm/blob/main/LICENSE"><img src="https://img.shields.io/github/license/algorithmicsuperintelligence/optillm" alt="License"></a>
</p>

<p align="center">
  <a href="https://huggingface.co/spaces/codelion/optillm">🤗 HuggingFace Space</a> •
  <a href="https://colab.research.google.com/drive/1SpuUb8d9xAoTh32M-9wJsB50AOH54EaH?usp=sharing">📓 Colab Demo</a> •
  <a href="https://github.com/algorithmicsuperintelligence/optillm/discussions">💬 Discussions</a>
</p>

---

**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](optillm/cepo) 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:

```bash
# 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!
```

```python
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](#sota-results-on-benchmarks-with-optillm)* ⬇️

## 🏗️ Installation

### Using pip

```bash
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

```bash
do
```

---

**Machine-readable endpoints**

- JSON: [`/api/graphcanon/tools/algorithmicsuperintelligence-optillm`](/api/graphcanon/tools/algorithmicsuperintelligence-optillm)
- LLM index: [/llms.txt](/llms.txt)
- Full corpus: [/llms-full.txt](/llms-full.txt)

_GraphCanon - The knowledge graph for AI development. https://www.graphcanon.com/_
