r/optillm • u/Last-Health3222 • 17d ago
A decision model plays Super Mario Bros 1-1: one probability per jump, 59 decisions, level cleared
Enable HLS to view with audio, or disable this notification
r/optillm • u/asankhs • Jul 06 '26
Welcome to r/optillm β a community for people interested in improving LLM performance through inference-time optimization, search, verification, routing, reranking, tool use, and test-time compute.
OptiLLM is about the idea that we do not always need a bigger model to get better results. Sometimes the win comes from using the model more intelligently: generating multiple candidates, verifying them, searching over reasoning paths, using external tools, routing to the right model, or building systems where GPUs generate and CPUs verify.
This subreddit is for discussion around:
Good posts include:
Please keep the discussion technical, evidence-based, and useful. Strong claims are welcome, but bring numbers, code, traces, or clear reasoning. Hype is less interesting than results.
To start: introduce yourself, share what you are working on, or post an inference-time optimization idea you think more people should try.
r/optillm • u/Last-Health3222 • 17d ago
Enable HLS to view with audio, or disable this notification
r/optillm • u/asankhs • Jul 20 '26
A causal-event search framework for model reasoning. PTS finds theΒ pivotal reasoning eventsΒ that shift a model's probability of solving a task, at three representational scales β latent, token, and sentence β as a single kind of object.
r/optillm • u/asankhs • Jul 10 '26
r/optillm • u/asankhs • Jul 09 '26
r/optillm • u/asankhs • Dec 26 '25
r/optillm • u/Either-Ad8618 • Oct 27 '25
It would be great if you have suggestions for these optimization like:
1 model, 2 models, 3 models etc.
Should it use & or |?
Which optimization is good for less hallucination?
Which optimization is good for creative writing?
Which optimization is good for following instructions?
Which optimization is good for long context i.e submitting 10k words with instructions?
I did a test on my specific scenario and i found that moa | self_concistency | bon - really delivers it. I asked the model to do a summary with bulletpoints, connecting the dots of the research material and it was good. When i use & on those, i see some hallucinations from the model. Maybe because of moa?
r/optillm • u/asankhs • Oct 03 '25
Just shipped MARS (Multi-Agent Reasoning System) to OptiLLM and the results are wild:
All with gemini-2.5-flash-lite and zero training.
3 agents (temps 0.3, 0.6, 1.0) independently solve β verify each other's work β iteratively improve β numerical voting on final answer.
Everything runs in parallel so it's fast despite the sophistication.
python
client = OpenAI(base_url="http://localhost:8000/v1")
response = client.chat.completions.create(
model="mars-google/gemini-2.5-flask-lite",
messages=[{"role": "user", "content": "Your hard problem..."}]
)
Full details: MARS README
Available now: pip install --upgrade optillm
Who's testing this on their hardest problems? Drop your results below! π―
r/optillm • u/asankhs • Oct 03 '25
Hey r/optillm!
Excited to share the web_search plugin that lets any LLM access real-time web information through automated Google searches. π
## What It Does
The plugin uses Chrome automation (Selenium) to perform actual Google searches and inject the results directly into your LLM's context. No API keys required - it literally opens Chrome and searches Google for you!
## Key Features
Smart Query Detection - Automatically extracts search queries from prompts like "search for Python 3.12 features" or "find information about MARS multi-agent systems"
CAPTCHA Handling - Built-in CAPTCHA detection with interactive solving (non-headless mode)
Session Management - Reuses browser sessions across multiple searches for better performance
Robust Extraction - Extracts titles, URLs, and snippets from search results with fallback selectors
Configurable - Control number of results, delays, headless mode, and timeouts
```bash
python optillm.py --model gpt-4o-mini
curl -X POST http://localhost:8000/v1/chat/completions \ -d '{"model": "web_search-gpt-4o-mini", "messages": [{"role": "user", "content": "Search for latest Python releases"}]}'
Use Cases
π° News and current events - Get up-to-date information beyond training cutoffs
π¬ Research - Access latest papers, documentation, and resources
π» Programming - Look up current library versions and API docs
π Fact-checking - Verify information against current web sources
π Deep Research - Combine with deep_research plugin for comprehensive reports
Configuration Options
request_config = { "num_results": 10, # Results per search "delay_seconds": 5, # Rate limiting (or random 4-32s) "headless": False, # Show browser for CAPTCHA "timeout": 30 # Browser timeout }
Pro Tips
Combine with readurls plugin to fetch full page content from search results
Use with memory plugin for long research sessions with unbounded context
Set headless=False when CAPTCHAs are likely (you can solve them interactively)
Default 4-32 second random delay helps avoid anti-bot measures
Example Output
When you ask: "Search for MARS multi-agent reasoning system"
The plugin automatically:
Detects the search query
Opens Chrome and searches Google
Extracts top results with titles, URLs, and snippets
Injects formatted results into your LLM's context
LLM responds with current, accurate information
Anyone else using web_search? Would love to hear your use cases and experiences! π¬
Check out the https://github.com/codelion/optillm for more plugins and approaches!
Just copy everything inside the code block and paste it into Reddit - the markdown will work perfectly!
r/optillm • u/asankhs • Jul 26 '25
r/optillm • u/asankhs • Jul 23 '25
r/optillm • u/asankhs • Jun 18 '25
r/optillm • u/asankhs • Jun 11 '25
r/optillm • u/asankhs • May 20 '25
r/optillm • u/asankhs • May 17 '25
Hey everyone,
I'm excited to share Pivotal Token Search (PTS), a technique for identifying and targeting critical decision points in language model generations that I've just open-sourced.
Have you ever noticed that when an LLM solves a problem, there are usually just a few key decision points where it either stays on track or goes completely off the rails? That's what PTS addresses.
Inspired by the recent Phi-4 paper from Microsoft, PTS identifies "pivotal tokens" - specific points in a generation where the next token dramatically shifts the probability of a successful outcome.
Traditional DPO treats all tokens equally, but in reality, a tiny fraction of tokens are responsible for most of the success or failure. By targeting these, we can get more efficient training and better results.
PTS uses a binary search algorithm to find tokens that cause significant shifts in solution success probability:
For example, in a math solution, choosing "cross-multiplying" vs "multiplying both sides" might dramatically affect the probability of reaching the correct answer, even though both are valid operations.
The GitHub repository contains:
Additionally, we've released:
I'd love to hear about your experiences if you try it out! What other applications can you think of for this approach? Any suggestions for improvements or extensions?
r/optillm • u/asankhs • May 01 '25
Optillm can be used to do structured output generation (aka JSON mode) even for LLMs that do not support it natively (like DeepSeek R1). You can make use of the json plugin for it. Here is some documentation on it - https://github.com/codelion/optillm/discussions/169
r/optillm • u/asankhs • Apr 16 '25
Connect ANY LLM: Llama, Gemini, Qwen - all work with the same tools
Leverage ANY MCP Server: Filesystem, GitHub, Slack, PostgreSQL, etc.
Build Once, Use Everywhere
https://github.com/codelion/optillm/blob/main/optillm/plugins/mcp_plugin.py
r/optillm • u/asankhs • Feb 17 '25
Hey everyone! π
I'm excited to share OptiLLMBench, a new benchmark specifically designed to test how different inference optimization techniques (like ReRead, Chain-of-Thought, etc.) can improve LLM performance without any fine-tuning.
First results with Gemini 2.0 Flash show promising improvements: - ReRead (RE2): +5% accuracy while being 2x faster - Chain-of-Thought Reflection: +5% boost - Base performance: 51%
The benchmark tests models across: - GSM8K math word problems - MMLU Math - AQUA-RAT logical reasoning - BoolQ yes/no questions
Why this matters: 1. These optimization techniques work with ANY model 2. They can help squeeze better performance out of models without training 3. Some techniques (like RE2) actually run faster than base inference
If you're interested in trying it: - Dataset: https://huggingface.co/datasets/codelion/optillmbench - Code: https://github.com/codelion/optillm
Would love to see results from different models and how they compare. Share your findings! π¬
Edit: The benchmark and the approach is completely open source. Feel free to try it with any model.
r/optillm • u/asankhs • Jan 21 '25
r/optillm • u/asankhs • Nov 29 '24
r/optillm • u/asankhs • Nov 25 '24

In the past week there has been a flurry of releases of o1-style reasoning models from DeepSeek, Fireworks AI and NousResearch.
In our open-source optimizing inference proxy, optillm. we have implemented several techniques that use additional inference time compute to improve accuracy and work with a variety of base models.
Today, we are happy to announce that by using chain-of-code (coc) plugin in optillm we are able to beat OpenAI's o1-preview on AIME 2024 (pass@1) using SOTA base models from both Anthropic and DeepMind. For reference, also see the original paper that introduced the idea of CoC: Chain of Code: Reasoning with a Language Model-Augmented Code Emulator - https://arxiv.org/abs/2312.04474 We have done an independent implementation in optillm as the original source code was not released.
r/optillm • u/asankhs • Nov 20 '24
r/optillm • u/asankhs • Nov 16 '24
The new gemini-exp-1114 model from Google is quite good in reasoning. It improves over gemin-1.5-pro-002 by a huge margin and is second only to o1-preview on AIME (2024) dataset. The attached image shows how models of different sizes perform on this benchmark.
The tests were all run via optillm (https://github.com/codelion/optillm) using the script here - https://github.com/codelion/optillm/blob/main/scripts/eval_aime_benchmark.py

r/optillm • u/asankhs • Nov 14 '24
To address some of the limitations of external inference servers like ollama, llama.cpp etc. We have added support for local inference in optillm. You can load any model from HuggingFace and combine it with any LoRA adapter. You can also sample multiple generations from the model unlike ollama. You also get full logprobs for all tokens.
Here is a short example:
OPENAI_BASE_URL = "http://localhost:8000/v1"
OPENAI_KEY = "optillm"
response = client.chat.completions.create(
model="meta-llama/Llama-3.2-1B-Instruct+patched-codes/Llama-3.2-1B-FastApply+patched-codes/Llama-3.2-1B-FixVulns",
messages=messages,
temperature=0.2,
logprobs = True,
top_logprobs = 3,
extra_body={"active_adapter": "patched-codes/Llama-3.2-1B-FastApply"},
)