SDK Reference
Tuner
Creating Nomadic Tuners
BaseParamTuner
Class
Overview
The BaseParamTuner
class provides a framework for creating custom parameter tuners that iterate over hyperparameters to find the best configuration based on a scoring function. It supports fixed parameters, current hyperparameter values, and saving results to a file.
Evaluator
Your tuner’s evaluator will by default run the evaluator specified in Experiment according to your use case. See Evaluators for details.
Fields
Parameter | Type | Default | Description | Required |
---|---|---|---|---|
param_fn | Callable[[Dict[str, Any]], Any] | N/A | The objective function that scores the LLM system being optimized on the specified parameters. | Yes |
param_dict | Optional[Dict[str, Any]] | None | A dictionary of parameters to iterate over. | No |
fixed_param_dict | Optional[Dict[str, Any]] | {} | A dictionary of fixed parameters passed to each job. | No |
current_param_dict | Optional[Dict[str, Any]] | {} | A dictionary of current hyperparameter values. | No |
show_progress | bool | False | Flag to show progress during tuning. | No |
num_prompts | int | 1 | Number of prompt variations to generate for each data point. | No |
results_filepath | Optional[str] | None | Path for saving tuner run results. | No |
Methods
fit() -> ExperimentResult
An abstract method that should be implemented by subclasses to perform parameter tuning.
save_results_table(results: pd.DataFrame, filepath: str) -> None
Saves the results to a CSV file.