AI & LLM

Fine-Tuning Dataset Example (JSONL) JSON Example

A JSON / JSONL example of an LLM fine-tuning training record — the chat messages format with system, user, and assistant turns. Copy-ready for OpenAI and open-model fine-tuning.

{
  "messages": [
    {
      "role": "system",
      "content": "You are a support agent for Acme Corp. Be concise and friendly."
    },
    {
      "role": "user",
      "content": "How do I cancel my subscription?"
    },
    {
      "role": "assistant",
      "content": "Go to Settings → Billing → Cancel subscription. Your access continues until the end of the current period."
    }
  ]
}

Field Reference

messagesrequiredarray<object>One full conversation per training line; the model learns to produce the assistant turn(s)
messages[].rolerequiredstringsystem, user, or assistant — assistant turns are the learning target
messages[].contentrequiredstringTurn text; keep it representative of real production prompts

Variants

JSONL file (multiple examples)A fine-tuning file is JSON Lines — one independent JSON object per line, not a JSON array.
JSONL file (multiple examples)
{
  "note": "Each line below is a separate JSON object in the .jsonl file",
  "line1": {
    "messages": [
      {
        "role": "user",
        "content": "Reset password?"
      },
      {
        "role": "assistant",
        "content": "Settings → Security → Reset password."
      }
    ]
  },
  "line2": {
    "messages": [
      {
        "role": "user",
        "content": "Change plan?"
      },
      {
        "role": "assistant",
        "content": "Settings → Billing → Change plan."
      }
    ]
  }
}
With tool callsFine-tuning the model to call a tool by including the tool call in the assistant turn.
{
  "messages": [
    {
      "role": "user",
      "content": "What's the weather in Paris?"
    },
    {
      "role": "assistant",
      "tool_calls": [
        {
          "id": "call_1",
          "type": "function",
          "function": {
            "name": "get_weather",
            "arguments": "{\"location\":\"Paris\"}"
          }
        }
      ]
    }
  ]
}

Common Use Cases

  • Preparing a training set to fine-tune a chat model on your domain
  • Teaching a model a consistent tone, format, or policy
  • Distilling a large model's behaviour into a smaller, cheaper one
fine-tuningjsonltraining dataopenaidatasetllm

Validate or format this JSON

One click loads this exact example into the tool — no copy-paste needed. Format it, validate it, explore the tree, or generate TypeScript types instantly.

Frequently Asked Questions

A fine-tuning file is JSONL (JSON Lines): each line is a complete, independent JSON object (one training example), with no enclosing array and no commas between lines. This lets tools stream millions of examples without loading the whole file into memory.

Often 50–100 high-quality examples produce a noticeable improvement; a few hundred to a few thousand is common for production. Quality and consistency matter more than raw volume — a small, clean, representative set beats a large noisy one.

Usually yes — keep it consistent so the model learns the behaviour you'll use at inference time. If you'll vary the system prompt in production, include that variety in your training data too.

Related JSON Examples