Skip to content
Novus Examples
jsonl2.5 KB

Chat Fine-tuning Dataset — Anthropic Format (JSONL)

The same synthetic conversations in the Anthropic Messages JSONL shape — a top-level system prompt plus a messages array of user and assistant turns. The format twin of the OpenAI file, for testing chat-format conversion.

Preview — first 11 linesjsonl
{"system": "You are a helpful assistant.", "messages": [{"role": "user", "content": "What's the capital of Australia?"}, {"role": "assistant", "content": "The capital of Australia is Canberra, not Sydney as many people assume."}]}
{"system": "You are a concise coding assistant.", "messages": [{"role": "user", "content": "How do I reverse a list in Python?"}, {"role": "assistant", "content": "Use slicing: `reversed_list = my_list[::-1]`, or call `my_list.reverse()` to reverse it in place."}]}
{"system": "You are a friendly tutor.", "messages": [{"role": "user", "content": "Explain photosynthesis in one sentence."}, {"role": "assistant", "content": "Photosynthesis is how plants convert sunlight, water, and carbon dioxide into glucose and oxygen."}]}
{"system": "You are a helpful assistant.", "messages": [{"role": "user", "content": "Convert 25 degrees Celsius to Fahrenheit."}, {"role": "assistant", "content": "25°C equals 77°F. The formula is (C × 9/5) + 32."}]}
{"system": "You are a travel guide.", "messages": [{"role": "user", "content": "What should I pack for a rainy city break?"}, {"role": "assistant", "content": "A compact umbrella, a waterproof jacket, quick-dry shoes, and a dry bag for electronics."}]}
{"system": "You are a helpful assistant.", "messages": [{"role": "user", "content": "What is a prime number?"}, {"role": "assistant", "content": "A prime number is a whole number greater than 1 whose only divisors are 1 and itself, like 2, 3, 5, and 7."}]}
{"system": "You are a cooking assistant.", "messages": [{"role": "user", "content": "How long should I boil an egg for it to be hard-boiled?"}, {"role": "assistant", "content": "About 9 to 12 minutes in boiling water, then transfer it to cold water to stop cooking."}]}
{"system": "You are a concise assistant.", "messages": [{"role": "user", "content": "Give me a synonym for 'happy'."}, {"role": "assistant", "content": "'Cheerful' works well; 'content' and 'delighted' are good alternatives depending on the tone."}]}
{"system": "You are a helpful assistant.", "messages": [{"role": "user", "content": "What does HTTP stand for?"}, {"role": "assistant", "content": "HTTP stands for HyperText Transfer Protocol, the foundation of data exchange on the web."}]}
{"system": "You are a fitness coach.", "messages": [{"role": "user", "content": "How many steps a day is often recommended?"}, {"role": "assistant", "content": "A common target is around 8,000 to 10,000 steps a day, though any increase over your baseline helps."}]}

Specifications

Conversations
10
Format
Anthropic Messages
Fields
system, messages[]
Task
chat fine-tuning

What is a .jsonl file?

JSONL (JSON Lines) is a text format where each line is a complete, independent JSON value, allowing records to be streamed and appended without parsing the whole file. It is not itself a JSON array and each line must stand alone. It is common in logging, machine learning datasets, and data pipelines.

How to use this file

Use an example JSONL to test line-by-line streaming parsers, append-and-resume ingestion, and batch pipelines that process one record per line.

Code examples

import json

with open("chat-anthropic.jsonl") as f:
    rows = [json.loads(line) for line in f]
print(len(rows), rows[0])

Generated by generation/ai_datasets.py. Free for any use, no attribution required — license.