treequest  by SakanaAI

Tree search library for LLM inference scaling

Created 2 months ago
459 stars

Top 65.9% on SourcePulse

GitHubView on GitHub
Project Summary

TreeQuest is a Python library designed for flexible answer tree search, primarily aimed at scaling Large Language Model (LLM) inference. It provides an easy-to-use API for defining custom node generation and scoring logic, enabling users to explore complex search spaces efficiently.

How It Works

TreeQuest implements variants of Adaptive Branching Monte Carlo Tree Search (AB-MCTS), including ABMCTS-A (with node aggregation) and ABMCTS-M (with mixed models). The core idea is to represent the search space as a tree where each node contains a state and a score. Users define a generate function that, given a parent state, produces new child states and their associated scores. The library then uses AB-MCTS algorithms to intelligently explore this tree, prioritizing promising branches to find optimal solutions. This approach allows for adaptive scaling of LLM inference by exploring multiple response paths simultaneously.

Quick Start & Requirements

  • Installation: uv add "treequest[abmcts-m]" or pip install "treequest[abmcts-m]".
  • Requirements: Python 3.11+. AB-MCTS-M requires additional dependencies.
  • Usage: The README provides examples for basic usage, integrating LLMs for node generation, and utilizing multiple LLMs or actions.

Highlighted Details

  • Supports AB-MCTS-A and AB-MCTS-M algorithms.
  • Enables Multi-LLM AB-MCTS for diverse exploration strategies.
  • Features checkpointing and resuming capabilities for long searches.
  • Allows customization of node generation, scoring, prompts, and actions.

Maintenance & Community

The project is associated with a paper published on arXiv (arXiv:2503.04412), indicating active research and development. Contribution guidelines are available in CONTRIBUTING.md.

Licensing & Compatibility

The library is licensed under the Apache 2.0 license, which permits commercial use and linking with closed-source projects.

Limitations & Caveats

The AB-MCTS-M variant requires installing extra dependencies. The library is relatively new, with its primary research paper dated 2025, suggesting potential for evolving APIs or undiscovered edge cases.

Health Check
Last Commit

1 month ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
14 stars in the last 30 days

Explore Similar Projects

Starred by Lianmin Zheng Lianmin Zheng(Coauthor of SGLang, vLLM), Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), and
1 more.

MiniCPM by OpenBMB

0.4%
8k
Ultra-efficient LLMs for end devices, achieving 5x+ speedup
Created 1 year ago
Updated 1 week ago
Starred by Carol Willing Carol Willing(Core Contributor to CPython, Jupyter), Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), and
9 more.

dynamo by ai-dynamo

1.0%
5k
Inference framework for distributed generative AI model serving
Created 6 months ago
Updated 16 hours ago
Feedback? Help us improve.