OptiLLM is an OpenAI API-compatible inference proxy that wraps existing chat endpoints with named optimization techniques. It supports many providers, optional local Hugging Face inference, Docker deployment, and gateway-style routing plugins.
Overview
OptiLLM sits between your client code and an upstream OpenAI-compatible LLM endpoint. Clients keep using familiar SDKs but select techniques by prefixing model names, combining slugs with ampersand pipelines or parallel bar branches, or fixing a default approach on the server.
Built-in approaches include planning and reflection methods, best-of-N sampling, mixture-of-agents critiques, MCTS-style decoding, Z3-backed logical reasoning, and several provider-specific planners documented in the technique tables. Plugins add memory compaction, MCP tool use, privacy redaction, JSON schema outputs, web search, deep research loops, and multi-provider load balancing without separate gateway fees.
You can run a lightweight proxy container, a full image with local models, or an offline image with bundled dependencies. Environment variables configure OpenAI, Azure, Gemini via LiteLLM, or a built-in local server keyed with OPTILLM_API_KEY. The process binds to a host and port, forwards chat completions, and can stream responses over SSE.
Docker Compose is documented for repository deployments with keys in compose or env files. Local-only decoding modes require the built-in inference server because some external engines cannot sample multiple completions per request.
Key features
- OpenAI-compatible chat proxy
- Twenty-plus inference techniques
- Technique prefixes on model names
- Multi-provider via LiteLLM
- Docker and compose deployment
- Local Hugging Face inference mode
- MCP client plugin
- LLM gateway load-balancing plugin
Use cases
- Improving reasoning without fine-tuning
- Uniform API across many LLM hosts
- Self-hosted LLM routing gateway
- Chaining optimization techniques
- Tool-enabled agents through MCP