jsonlkit.com
JSONL (JSON Lines) utilities, in the browser
Say hi →

The ShareGPT Format

Format reference · updated 28 July 2026 · overview · spec · format comparison · examples · best practices · troubleshooting · FAQ · glossary

ShareGPT is the community conversation format behind a large share of open fine-tuning datasets and the recipes in Axolotl and LLaMA-Factory. It has no specification, several role-name variants, and one structural quirk worth understanding before you convert anything into or out of it.

The shape

{"conversations":[{"from":"system","value":"You are a helpful assistant."},{"from":"human","value":"What is 2+2?"},{"from":"gpt","value":"4"}]}
{"conversations":[{"from":"human","value":"Capital of France?"},{"from":"gpt","value":"Paris"}]}

One conversation per line, in a conversations array. Each turn has a speaker (from) and text (value). That is the entire format — the differences from OpenAI's shape are purely naming:

ShareGPTOpenAI
conversationsmessages
fromrole
valuecontent
humanuser
gptassistant

The variants you will actually encounter

Because there is no spec, real datasets disagree on the details. Anything reading ShareGPT needs to be liberal:

Our converter accepts all of these variants on the way in and emits the canonical human/gpt spelling on the way out.

The alternation quirk

Most trainers assume turns alternate human, assistant, human, assistant — and ShareGPT files in the wild frequently do not. Two consecutive human turns, a conversation that starts with the assistant, or a trailing human turn with no reply are all common, usually because the data was scraped from shared chat logs where the user sent two messages in a row.

What happens next depends on the trainer: some merge consecutive turns, some error, some silently drop the record. If you are producing ShareGPT data, normalise the alternation. If you are consuming it, check it — the provider validators report alternation problems after you convert to a provider format, which is the easiest way to audit a ShareGPT file.

Converting to and from

To OpenAI chat — a straight key-for-key rename plus the role mapping. Lossless in both directions for text conversations.

To Anthropic — same rename, except the system turn moves out of the array to a top-level system key. Forgetting that produces a file that looks right and is rejected.

To Alpacalossy. Alpaca holds one exchange, so a multi-turn ShareGPT conversation cannot survive: the first human turn becomes instruction, the first assistant turn becomes output, and everything after is dropped. The converter reports how many records were truncated rather than doing it silently.

From Alpaca to ShareGPT — always safe, since one exchange is a valid two-turn conversation. instruction plus input becomes the human turn, output the gpt turn.

Where it is used

If you are choosing a format

Prefer OpenAI chat as your canonical internal shape, and convert outward as needed. Reasons:

Keep ShareGPT for interoperability with the open datasets and recipes that expect it — which is a real and ongoing need, just not a reason to make it your source of truth.

Frequently asked questions

Is there an official ShareGPT specification?

No. The name comes from the ShareGPT browser extension that popularised sharing chat transcripts, and the format is a community convention that grew from that export shape. The variants exist precisely because nothing pinned it down.

What does from: system mean if a trainer does not support it?

Behaviour varies — some prepend it to the first human turn, some drop it. If the system prompt matters to your task, convert to a format with explicit support and confirm it survived.

Can ShareGPT represent tool calls?

Not in any standard way. Some datasets encode them as text inside value, which no trainer interprets structurally. If you are training tool use, use the OpenAI format.

Which is better, ShareGPT or Alpaca?

ShareGPT, unless your data is genuinely single-turn instruction/response — it handles multi-turn conversations and system prompts, and Alpaca cannot. Converting Alpaca to ShareGPT is safe; the reverse loses turns.

How do I check a ShareGPT file is well-formed?

Convert it to OpenAI chat with the converter, then run the OpenAI validator. That combination catches role problems, alternation issues and empty turns in one pass.

Tools mentioned on this page

— S., [email protected]