Skip to main content
Helicone’s Datasets and Fine Tuning feature can be used in combination with Ragas to provide evals for your LLM application.

Prerequisites

If you wish to evaluate on real requests follow the quick start documentation. For this tutorial, the Helicone demo will be used, which contains mock request data. Follow the dataset documentation to add LLM responses to a dataset. Then, download the dataset as a CSV by clicking the “export data” button on the upper right hand corner. This will output a CSV with the following columns: _type,id,schema,preview,model,raw,heliconeMetadata. https://youtu.be/Dsy1kdSOJ1k

Human Labeling

Add a column to the CSV exported from Helicone with mock_data which includes gold answers. Below is an example script which augments the CSV exported from Helicone with an additional column. It will copy the LLM’s response into the golden answer column as a placeholder. Then, replace each of the column’s cells with the correct output corresponding to the user input. Adding gold answer column to the CSV:

Defining Metrics

Ragas provides several metrics with which to evaluate LLM responses. The below script showcases how to take in as input the human annotated CSV, then evaluate based on the answer correctness and semantic answer similarity metric.
This will output a result containing the correctness and semantic similarity metrics for those LLM responses:

Performance Metrics

Scores generated by Ragas or other evaluation tools can be added directly into Helicone. This can be done either through the UI or through the Helicone request/response API.

UI

Click on any request within the requests page, then add properties with your metrics for each respective request. Refer to https://docs.helicone.ai/features/advanced-usage/custom-properties for more information.

Helicone Scoring API

Follow https://docs.helicone.ai/rest/request/post-v1request-score and annotate each respective request with the score generated from Ragas. Here is an example script which submits scores outputted from Ragas to annotate each corresponding request:

Trace Annotation and Annotation Queues

We have developed the infrastructure for annotating evaluation traces and managing annotation queues, improving accuracy, traceability, and collaboration during evaluations. We will build out the UI further within the Helicone platform to better support attachment of feedback to specific runs, grouping runs together, and providing feedback on these group runs.

Data Exports for Evals

We plan to add better data export controls to support evals with performance and task metrics as part of the export. This will enable easier integration with third parties such as Ragas.

Response and Task Metrics

On our roadmap is targeted evaluation metrics for assessing response quality and task-specific performance, such as evaluating whether an agent selected the correct tool or used a tool correctly given a scenario the agent is tasked to complete.