Thanks to visit codestin.com
Credit goes to github.com

Skip to content

LiuzLab/consol

Repository files navigation

🎮 ConSol: Confident Solver

Solve problems confidently and efficiently using a statistical approach with LLM

PyPI version

🤗 Getting Started

# This command installs the ConSol package from PyPI.
pip install consol

Usage as a CLI

$ consol --prompt "1 + 1 = ?"
2

Usage as a SDK

from consol import ConfidentSolver

# Initialize the ConfidentSolver with the following parameters:
# llm_model: The language model to use, e.g., "gpt-4o-mini", "o3-mini-low".
# confidence_model: The statistical model to determine confidence, e.g., "pvalue", "sprt", "bayesian".
# output_schema: The format of the output, e.g., "reasoned_float", "float".
consol = ConfidentSolver(
    llm_model="gpt-4o-mini",
    confidence_model="pvalue",
    output_schema="reasoned_float",
)
answer = consol.invoke("1 + 1 = ?")
print(answer)
# => 2

🤔 What is ConSol?

ConSol is a framework designed to solve various problems, primarily mathematical, by leveraging a statistical approach. This approach suppresses randomness and results in higher accuracy cost-efficiently.

For the details, please refer to the publication.