llm-reasoners  by maitrix-org

Library for advanced LLM reasoning with search algorithms

created 2 years ago
2,192 stars

Top 21.0% on sourcepulse

GitHubView on GitHub
Project Summary

This library provides a framework for enhancing Large Language Models (LLMs) with advanced reasoning capabilities, targeting researchers and developers building complex AI applications. It offers a suite of cutting-edge reasoning algorithms and tools for visualization and efficient inference, aiming to improve LLM performance on tasks requiring step-by-step problem-solving.

How It Works

The library abstracts LLM reasoning into three core components: reward function, world model, and search algorithm. Users can implement custom reasoning by inheriting provided classes for SearchConfig and WorldModel, and integrating pre-built SearchAlgorithm implementations. This modular design allows for flexible integration of various LLM backends (e.g., SGLang, Hugging Face Transformers, OpenAI API) and supports advanced search techniques like MCTS, BFS, DFS, and Tree-of-Thoughts.

Quick Start & Requirements

  • Install via pip: pip install llm-reasoners
  • Install from GitHub (recommended for examples): git clone --recursive https://github.com/Ber666/llm-reasoners followed by cd llm-reasoners and pip install -e .
  • Requires Python 3.10 or later.
  • Optional dependencies like exllama and LLM-Planning are cloned recursively.
  • Official documentation and tutorials are available.

Highlighted Details

  • Supports a wide range of reasoning algorithms including Chain-of-Thoughts, Tree-of-Thoughts, GRACE Decoding, Eurus, and PromptAgent.
  • Integrates with SGLang for up to 100x inference speed-up.
  • Provides visualization tools to understand and debug reasoning processes.
  • Focuses on rigorous implementation and reproducibility, with benchmarks showing successful reproduction of prior work.
  • Includes a ReasonerAgent for web-based research and query answering.

Maintenance & Community

  • Active development with recent updates including Deepseek R1, ReasonerAgent, SGLang integration, and DRPO.
  • Paper accepted to COLM 2024.
  • Discord server available for community support.

Licensing & Compatibility

  • The project is licensed under the Apache License 2.0.
  • Compatible with commercial use and closed-source linking.

Limitations & Caveats

The library is under active development, with some features and examples potentially being experimental or subject to change. Specific LLM backends or reasoning algorithms might have their own dependencies or performance characteristics that require careful consideration.

Health Check
Last commit

1 month ago

Responsiveness

1 week

Pull Requests (30d)
0
Issues (30d)
2
Star History
86 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.