baybe icon indicating copy to clipboard operation
baybe copied to clipboard

Feature: Add LLMRecommender

Open tobiasploetz opened this issue 7 months ago • 2 comments

Example usage:

from baybe.recommenders.pure.llm.llm import LLMRecommender, ParameterDescription

experiment_description = "This experiment is about a aryl halide reaction."
objective_description = "Maximize the `yield` of the reaction. Minimum is 0, maximum is 100."
parameter_descriptions = [
    ParameterDescription(name="base", description="The base used in the reaction.", type="categorical", bounds=base_values),
    ParameterDescription(name="ligand", description="The ligand used in the reaction.", type="categorical", bounds=ligand_values),
    ParameterDescription(name="additive", description="The additive used in the reaction.", type="categorical", bounds=additive_values),
    ParameterDescription(name="aryl_halide", description="The aryl halide used in the reaction.", type="categorical", bounds=aryl_halide_values),
]

recommender = LLMRecommender(
    model="azure/gpt-4o-mini",
    experiment_description=experiment_description,
    objective_description=objective_description,
    parameter_descriptions=parameter_descriptions,
    litellm_args={"temperature": 0.5},
    recovery_model="azure/gpt-4o-mini",
    recovery_litellm_args={"temperature": 0.2},
)

tobiasploetz avatar Jun 02 '25 16:06 tobiasploetz

@tobiasploetz - with #580 now being merged, what is the state here?

AVHopp avatar Aug 05 '25 08:08 AVHopp

@tobiasploetz - with #580 now being merged, what is the state here?

I need to modify this PR to use the new metadata fields. It's in the backlog :)

tobiasploetz avatar Aug 05 '25 08:08 tobiasploetz