Fine-Tuning Models in Klu

In the rapidly evolving landscape of LLMs within production environments, the capability to fine-tune your models with precision is crucial. Klu facilitates this by enabling the import of targeted data through both UI and SDK, offering robust management and feedback systems, and providing versatile data export options for iterative model improvement.

Filter Data

Enhancing your model's accuracy and response quality through fine-tuning begins with the import of relevant data into Klu.

Importing via the UI

Navigate to the Fine-Tuning section within your App and select Import Fine-Tuning Data from the options. We recommend the JSONL format for its compatibility and provide templates to streamline the process.

Importing via the SDK

Leveraging the Klu SDK, importing data for fine-tuning is made efficient with a few simple steps:

  • Initialize your Workspace and secure your API key
  • Create a new App and specify the Fine-Tuning Action
  • Use the Fine-Tuning Action GUID for data import

Fine-Tuning Data Import

from klu import Klu

klu = Klu("YOUR_API_KEY")

prompt = "Specific prompt for fine-tuning"
response = "Desired model response"
fine_tuning_action = "fine_tuning_action_guid"
relevance_score = "Relevance score based on your criteria"

fine_tune_data = klu.fine_tune.create(prompt=prompt, response=response, fine_tuning_action=fine_tuning_action, score=relevance_score)


This streamlined process ensures your model can be continuously improved and adapted to meet specific needs.

Save Dataset

In the Fine-Tuning section of your App, you can view all data points used for model refinement. Klu offers comprehensive filters to help you isolate and analyze the data most relevant to your fine-tuning efforts:

  • Date Range: Choose the timeframe of the data.
  • Fine-Tuning Action: Select the specific action used for fine-tuning.
  • Prompt/Response Search: Locate specific prompts or responses.
  • Relevance Score: Filter by the relevance scores to assess the impact on model performance.
  • Source: Identify the origin of the fine-tuning data.
  • Insights: Utilize metrics such as accuracy, relevance, or custom metrics for deeper analysis.
  • Klu User: Filter by the user or SDK key that submitted the data.
  • Model Issue: Focus on data highlighting specific issues like inaccuracies or biases.

Saving your filtered dataset as a named Fine-Tuning Set is possible, facilitating ongoing model development and refinement.

Kick off Fine-Tuning

  • Name

    Klu supports direct feedback on fine-tuning efforts, allowing for the iterative enhancement of model outputs. Indicate the effectiveness of a fine-tuning instance using the thumbs up or thumbs down icons within the app.

These icons simplify the process of rating the success of fine-tuning efforts as positive or negative.

For more nuanced feedback, such as adjustments to responses or highlighting specific issues, click on the icon next to the data point.

In the feedback modal, you can detail:

  • Fine-Tuning Context - offer context for the fine-tuning, including scenarios or parameters.
  • Model Issue - point out any issues with the model's response, such as inaccuracies or biases.
  • Response Improvement - propose enhancements or corrections to the model's response.

Leveraging these feedback tools is essential for the continuous improvement and fine-tuning of your models.

Evaluating Performance

Klu provides comprehensive control over your fine-tuning data, with flexible export options to support your workflow:

  • CSV - for straightforward analysis in spreadsheet applications.
  • JSONL - for integration into other systems, supporting further fine-tuning or evaluations.

Export functionality is also available through the API or SDK, ensuring your data can move with your project's needs.