> ## Documentation Index
> Fetch the complete documentation index at: https://docs.helicone.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# How to fine-tune LLMs with Helicone and OpenPipe

> Learn how to fine-tune large language models with Helicone and OpenPipe to optimize performance for specific tasks.

<Steps>
  <Step title="Add the OpenPipe Integration">
    Navigate to `Settings` -> `Connections` in your Helicone dashboard and configure the OpenPipe integration.

    <Frame>
      <img src="https://mintcdn.com/helicone/WIDUeIzURs2yWBd-/images/use-cases/fine-tune/openpipe-integration.webp?fit=max&auto=format&n=WIDUeIzURs2yWBd-&q=85&s=5d3d5e9ed5f2b8a86731af95e2fa33d0" alt="Configure OpenPipe Integration" width="3456" height="1928" data-path="images/use-cases/fine-tune/openpipe-integration.webp" />
    </Frame>

    This integration allows you to manage your fine-tuning datasets and jobs seamlessly within Helicone.
  </Step>

  <Step title="Create a Dataset for Fine-Tuning">
    Your dataset doesn't need to be enormous to be effective. In fact, smaller, high-quality datasets often yield better results.

    * **Recommendation**: Start with 50-200 examples that are representative of the tasks you want the model to perform.

    <Frame>
      <img src="https://mintcdn.com/helicone/WIDUeIzURs2yWBd-/images/use-cases/fine-tune/dataset.webp?fit=max&auto=format&n=WIDUeIzURs2yWBd-&q=85&s=eceddc8906826b412c2836c26eba77bb" alt="Create a new dataset" width="3456" height="1926" data-path="images/use-cases/fine-tune/dataset.webp" />
    </Frame>

    Ensure your dataset includes clear input-output pairs to guide the model during fine-tuning.
  </Step>

  <Step title="Evaluate and Refine Your Dataset">
    Within Helicone, you can evaluate your dataset to identify any issues or areas for improvement.

    * **Review Samples**: Check for consistency and clarity in your examples.
    * **Modify as Needed**: Make adjustments to ensure the dataset aligns closely with your desired outcomes.

    <Frame>
      <img src="https://mintcdn.com/helicone/WIDUeIzURs2yWBd-/images/use-cases/fine-tune/openpipe-button.webp?fit=max&auto=format&n=WIDUeIzURs2yWBd-&q=85&s=3f7d2061e74c72f477295428992df5f3" alt="Evaluate your dataset" width="3456" height="1928" data-path="images/use-cases/fine-tune/openpipe-button.webp" />
    </Frame>

    Regular evaluation helps in creating a robust fine-tuning dataset that enhances model performance.
  </Step>

  <Step title="Configure Your Fine-Tuning Job">
    Set up your fine-tuning job by specifying parameters such as:

    * **Model Selection**: Choose the base model you wish to fine-tune.
    * **Training Settings**: Adjust hyperparameters like learning rate, epochs, and batch size.
    * **Validation Metrics**: Define how you'll measure the model's performance during training.

    <Frame>
      <img src="https://mintcdn.com/helicone/WIDUeIzURs2yWBd-/images/use-cases/fine-tune/fine-tune-config.webp?fit=max&auto=format&n=WIDUeIzURs2yWBd-&q=85&s=4e2bae51dfcb5fd2a60f8d46070a333d" alt="Configure your fine-tuning job" width="300" data-path="images/use-cases/fine-tune/fine-tune-config.webp" />
    </Frame>

    After configuring, initiate the fine-tuning process. Helicone and OpenPipe handle the heavy lifting, providing you with progress updates.
  </Step>

  <Step title="Deploy and Monitor Your Fine-Tuned Model">
    Once fine-tuning is complete:

    * **Deployment**: Integrate the fine-tuned model into your application via Helicone's API endpoints.
    * **Monitoring**: Use Helicone's observability tools to track performance, usage, and any anomalies.
  </Step>
</Steps>

## Additional Fine-Tuning Resources

For more information on fine-tuning, check out these resources:

* [Fine-Tuning Best Practices: Training Data](https://openpipe.ai/blog/fine-tuning-best-practices-series-introduction-and-chapter-1-training-data)
* [Fine-Tuning Best Practices: Models](https://openpipe.ai/blog/fine-tuning-best-practices-chapter-2-models)
* [How to use OpenAI fine-tuning API](/faq/openai-fine-tuning-api)
* [Understanding fine-tuning duration](/faq/llm-fine-tuning-time)
* [Comparing RAG and fine-tuning approaches](/faq/rag-vs-fine-tuning)
