optillm

algorithmicsuperintelligence/optillm

Optimizing inference proxy for LLMs

4.2k
Stars
368
Forks
21
Open issues
39
Watchers
Python Apache-2.0Last pushed Jul 5, 2026

Optimizing inference proxy for LLMs

Categories

Tags

Similar tools

Install

pip install optillm

README

OptiLLM

πŸš€ 2-10x accuracy improvements on reasoning tasks with zero training

GitHub stars 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:

TechniqueBase ModelImprovementBenchmark
MARSGemini 2.5 Flash Lite+30.0 pointsAIME 2025 (43.3β†’73.3)
CePOLlama 3.3 70B+18.6 pointsMath-L5 (51.0β†’69.6)
AutoThinkDeepSeek-R1-1.5B+9.34 pointsGPQA-Diamond (21.72β†’31.06)
LongCePOLlama 3.3 70B+13.6 pointsInfiniteBench (58.0β†’71.6)
MOAGPT-4o-miniMatches GPT-4Arena-Hard-Auto
PlanSearchGPT-4o-mini+20% pass@5LiveCodeBench

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

do