Re-running an existing experiment
Re-running an existing experiment
Re-running an existing experiment
In Opik 2.0, datasets and experiments are project-scoped. Make sure to specify a project_name when creating datasets and running experiments so they are associated with the correct project.
You can update existing experiments in several ways:
You can update an experiment’s name and configuration from both the Opik UI and the SDKs.
To update an experiment from the UI:


The configuration is stored as JSON and is useful for tracking parameters like model names, temperatures, prompt templates, or any other metadata relevant to your experiment.
Use the update_experiment method to update an experiment’s name and configuration:
Use the updateExperiment method to update an experiment’s name and configuration:
Sometimes you may want to update an existing experiment with new scores, or update existing scores for an experiment. You can do this using the evaluate_experiment function.
This function will re-run the scoring metrics on the existing experiment items and update the scores:
The evaluate_experiment function can be used to update existing scores for an experiment. If you use a scoring
metric with the same name as an existing score, the scores will be updated with the new values.
You can also compute experiment-level aggregate metrics when updating experiments using the experiment_scoring_functions parameter.
Learn more about experiment-level metrics.
Suppose you are building a chatbot and want to compute the hallucination scores for a set of example conversations. For this you would create a first experiment with the evaluate function:
evaluate function in our LLM evaluation guide.Once the first experiment is created, you realise that you also want to compute a moderation score for each example. You could re-run the experiment with new scoring metrics but this means re-running the output. Instead, you can simply update the experiment with the new scoring metrics: