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

# Preparing datasets

> Learn how to prepare and format datasets for fine-tuning large language models with Second

Second supports a variety of dataset formats for fine-tuning large language models, including both conversational and completion datasets. This guide will walk you through the process of preparing your data in supported formats such as CSV, JSON, and JSONL.

Before you begin, it's important to note that not all models are optimized for all formats. Be sure to consult the specific model documentation to verify the supported dataset formats for your chosen model.

<Steps>
  <Step title="Preparing data">
    <Tip>
      Check out [Magic Datasets](/datasets/magic-datasets) for an easy way to
      generate high-quality datasets for fine-tuning large language models.
    </Tip>

    You can prepare your dataset in various formats, depending on the type of data you
    have and the model you plan to fine-tune. Here are some common dataset formats supported
    by Second, shown in JSONL (JSON Lines) format:

    <CodeGroup>
      ```json conversational.jsonl theme={null}
      {"text": "<|im_start|>user\nHello, how are you?\n<|im_end|>\n<|im_start|>assistant\nI'm doing well, thank you.\n<|im_end|>"}
      {"text": "<|im_start|>user\nWhat's the weather like today?\n<|im_end|>\n<|im_start|>assistant\nIt's sunny, with a high of 75 degrees.\n<|im_end|>"}
      ```

      ```json conversational.jsonl theme={null}
      {"messages": [{"role": "user", "content": "Hello, how are you?"}, "role": "assistant", "content": "I'm doing well, thank you."]}
      {"messages": [{"role": "user", "content": "What's the weather like today?"}, "role": "assistant", "content": "It's sunny, with a high of 75 degrees."]}
      ```
    </CodeGroup>
  </Step>

  <Step title="Uploading data">
    You can upload your prepared dataset directly to Second using the web interface or API. Follow these steps to upload your dataset:

    1. Log in to your Second account at [console.usesecond.com](https://console.usesecond.com)
    2. Navigate to the Datasets section
    3. Click on "Create New Dataset"
    4. Follow the prompts to upload your data and configure your dataset
  </Step>

  <Step title="Fine-tuning with your dataset">
    Once your dataset is uploaded, you can use it to fine-tune your chosen model. Follow these steps to start fine-tuning:

    1. Select the model you want to fine-tune
    2. Choose your uploaded dataset as the training data
    3. Configure the fine-tuning parameters
    4. Start the fine-tuning process
  </Step>
</Steps>
