AB-MCTS for Open WebUI: Tree Search Reasoning for Local LLMs via OpenWebUI and Ollama integration.
Running powerful AI reasoning on limited hardware? Here is an open-source tool that brings Monte Carlo Tree Search (MCTS) reasoning to Open WebUI, optimized for small local models built on research by Sakana AI’s AB-MCTS.
What is it?
AB-MCTS (Adaptive Branching Monte Carlo Tree Search) is a tree search algorithm that explores multiple solution paths in parallel, using LLMs to both generate answers and judge their quality. Think of it like having your AI brainstorm several approaches, refine the best ones, and pick the winner—all automatically.
This implementation integrates Sakana AI’s AB-MCTS algorithm with Open WebUI, making advanced reasoning accessible to anyone running local models on consumer hardware.
Key Features

Multi-Criterion Judge Evaluation: Answers are scored across 4 dimensions:
- Accuracy (25%) – factual correctness
- Completeness (25%) – thorough coverage
- Clarity (25%) – clear communication
- Relevance (25%) – stays on topic
Weights are fully configurable through the dashboard.
Thompson Sampling Depth Control: Instead of hard depth limits, the algorithm naturally balances exploration (trying new approaches) and exploitation (refining good ones) based on iteration count. More iterations = deeper trees when beneficial.
Optimized for Small Models: Tested on 0.6-1B parameter models, the system favors width (multiple attempts) over depth (refinement), since smaller models struggle with iterative improvement but excel at diverse generation.
Clean Open WebUI Integration: Automatically strips auto-generated task wrappers (tags, titles, follow-ups) to ensure AB-MCTS works on your actual questions, not meta-tasks.
Why Use This?
Traditional LLMs give one answer. AB-MCTS explores multiple solution paths, judges them objectively, and returns the best result.
Perfect for:

- Complex questions with multiple valid approaches
- Fact-checking and accuracy-critical tasks
- Limited hardware where you need quality over raw model size
- Research and experimentation with tree search reasoning
Technical Stack:
- Backend: Python, FastAPI
- Algorithm: Sakana AI’s TreeQuest AB-MCTS
- Integration: OpenAI-compatible API for Open WebUI
- Deployment: Docker Compose
- Persistence: JSON-based config across restarts
Get Started
The project is fully open source and ready to run: GitHub: https://github.com/johnsonfarmsus/openwebui-ab-mcts-pipeline
Simply clone, configure your models, and docker-compose up. The dashboard provides full control over iterations, judge selection, scoring weights, and multi-model ensembles.
Built for the community, by someone running AI on limited resources. Contributions welcome!
Built with inspiration from Sakana AI’s AB-MCTS research and optimized for real-world constraints.