SuperAPIAI Directory

optillm

github.com · AI developer platforms

an OpenAI API compatible optimizing inference proxy which implements several state-of-the-art techniques that can improve the accuracy and performance of LLMs.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsLinux

About this tool

OptiLLM is an OpenAI API-compatible optimized inference proxy designed to improve the accuracy and performance of large language models (LLMs) by increasing compute at inference time. It implements more than 20 advanced techniques and can achieve 2x to 10x accuracy improvements on tasks such as math, programming, and logical reasoning without any model training or fine-tuning.

Key Capabilities

  • Instant Improvement: Achieve 2-10x accuracy improvements on math, programming, and logical reasoning tasks.
  • Plug and Play: Works with any OpenAI-compatible API endpoint as a proxy for existing API calls.
  • 20+ Optimization Techniques: From simple best-of-N to advanced MCTS and planning techniques.
  • Zero Training Required: Simply route existing API calls through the OptiLLM proxy.
  • Production Ready: Already used in production environments by companies and researchers worldwide.
  • Multi-Provider Support: Supports OpenAI, Anthropic, Google, Cerebras, and more than 100 models via LiteLLM.

Usage

  1. Installation: Docker images are provided (full version, proxy-only version, offline version), or install from source (clone the repository and use pip to install dependencies).
  2. Configuration: Set the corresponding environment variables (such as OPENAI_API_KEY, GEMINI_API_KEY, etc.) and start the proxy. By default it binds to 127.0.0.1; external connections can be allowed via --host 0.0.0.0, and authentication can be enabled with --optillm-api-key.
  3. Calling: Set the OpenAI client's base_url to http://localhost:8000/v1 and it can be used as a direct replacement.
  4. Controlling Optimization Techniques: You can specify a technique by adding a slug before the model name (such as moa-gpt-4o-mini), passing the optillm_approach field in extra_body, or using the <optillm_approach> tag in the prompt. Combining multiple techniques with & and | is supported (& executes sequentially in a pipeline, | executes in parallel).
  5. Local Inference: Supports directly loading HuggingFace models or LoRA; after setting OPTILLM_API_KEY, it can be used. Adding multiple LoRAs via the + separator is supported, and the active_adapter parameter can be used to specify one.
  6. External Servers: Can be used with external servers such as llama.cpp or ollama by setting OPENAI_API_KEY to a placeholder value and specifying --base_url.
  7. MCP Integration: Supports the Model Context Protocol and can connect to local (stdio) and remote (SSE, Streamable HTTP) MCP servers; the configuration file is located at ~/.optillm/mcp_config.json.

Use Cases

  • Need to improve LLM accuracy on complex reasoning tasks (such as math, programming, and logic).
  • Want to optimize existing API calls without training a model.
  • Need to integrate multiple optimization techniques and combine them flexibly.
  • Use local models or external inference servers.
  • Need to connect external tools and data sources via the MCP protocol.

Limitations

  • Some providers (such as the Anthropic API, llama.cpp-server, and ollama) do not support sampling multiple responses from a model, so only some techniques are supported (cot_reflection, leap, plansearch, rstar, rto, self_consistency, re2, z3).
  • The /v1/completions endpoint of the local inference server does not yet support streaming (stream: true); use /v1/chat/completions instead.
  • By default it binds to localhost; external access must be explicitly configured and security considerations must be taken into account.
  • The readurls plugin has DNS rebinding known limitations; high-security deployments require additional restrictions on network egress.
  • Disabling SSL verification is limited to development environments only; production environments should use custom CA certificates.
Up/Down to navigate · Enter to open · ESC to closeBrowse all tools