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

Llama Fine-Tune JSONL Validator

updated 17 May 2026 · Llama 3.x / Llama 4 · ChatML · ShareGPT · Alpaca · separate pages for OpenAI, Anthropic, Gemini, Mistral

Llama fine-tune JSONL validator. Validates the three dataset shapes the open-source training stack actually uses: ChatML messages (Axolotl chat_template, Unsloth, TRL SFTTrainer, Together, Fireworks, Replicate, LLaMA-Factory, vLLM-LoRA), ShareGPT (legacy Axolotl, community datasets like OpenHermes / WizardLM / Glaive), and Alpaca (single-turn instruction tuning — Stanford Alpaca, Stanford Dolly, classic Q&A). Maps every error to the exact string Axolotl, Unsloth, or TRL print at startup.

Your training data never leaves this tab. The training platforms upload your file when a job starts; this pre-flight check is fully local.

⌨ Prefer the terminal? jsonlkit validate --llama data.jsonl · --sharegpt · --alpaca — same checks, in a pipe.

Validate

Drop a fine-tune .jsonl file here, or

Llama Fine-Tune JSONL Validator

Three formats, one page. The dominant 2026 shape is ChatML messages — same messages array OpenAI uses, accepted unchanged by Axolotl, Unsloth, TRL, Together, Fireworks, Replicate, LLaMA-Factory, and SageMaker JumpStart. ShareGPT (conversations + from/value) is the older format used by many community datasets and still works on Axolotl and Unsloth with a few config flags. Alpaca (instruction / input / output) is the classic single-turn instruction-tune shape that Stanford released in 2023 and that still appears in tutorials and many academic datasets. The JSONL shape is identical across Llama 3.1, 3.2, 3.3, and 4 — only the chat template (applied by the trainer at tokenization time) differs.

Validating a different provider? OpenAI, Anthropic (Claude), Google Gemini, Mistral.

Which format does my trainer want?

Trainer / platformDefault formatNotes
HuggingFace TRL SFTTrainerChatML messagesApply chat template via tokenizer.
Axolotl (≥ 0.6)ChatML messages (type: chat_template)type: sharegpt is deprecated in 0.6+.
UnslothChatML messagesShareGPT works after standardize_sharegpt().
LLaMA-FactoryChatML messagesConfigured via dataset_info.json.
Together AIChatML messagesOpenAI-compatible shape.
FireworksChatML messagesOpenAI-compatible shape.
ReplicateChatML messagesOpenAI-compatible shape.
SageMaker JumpStartChatML messagesFor Llama 3 fine-tune templates.
Community datasets (OpenHermes, WizardLM, Glaive)ShareGPTConvert to ChatML for modern trainers.
Stanford Alpaca / Dolly / classic instructionAlpacaSingle-turn only.

The three formats, side by side

ChatML messages (the 2026 default)

{"messages":[
  {"role":"system","content":"You are a precise SQL generator."},
  {"role":"user","content":"Users signed up last month?"},
  {"role":"assistant","content":"SELECT * FROM users WHERE created_at >= date_trunc('month', now() - interval '1 month');"}
]}

ShareGPT (legacy)

{"conversations":[
  {"from":"system","value":"You are helpful."},
  {"from":"human","value":"Hi"},
  {"from":"gpt","value":"Hello"}
]}

Roles are renamed: human ↔ user, gpt ↔ assistant, system stays. Content is in value, not content.

Alpaca (single-turn instruction tuning)

{"instruction":"Translate to French.","input":"Good morning","output":"Bonjour"}

input is optional — many Alpaca examples leave it empty when the prompt is self-contained. Each row is one independent training example; Alpaca doesn't support multi-turn conversations.

Tool calls (ChatML)

{"messages":[
  {"role":"user","content":"Weather in Paris?"},
  {"role":"assistant","content":null,"tool_calls":[
    {"id":"c1","type":"function","function":{"name":"get_weather","arguments":"{\"city\":\"Paris\"}"}}
  ]},
  {"role":"tool","tool_call_id":"c1","content":"18C, clear"},
  {"role":"assistant","content":"It's 18 C and clear in Paris."}
]}

DPO / preference (chosen / rejected)

{"prompt":"Summarize: ...","chosen":"Better answer.","rejected":"Worse answer."}

Used by TRL's DPOTrainer and Together's preference fine-tuning. Each row is one prompt with a preferred and rejected completion. Not validated as a primary mode on this page — use the ChatML mode and treat prompt as the user turn.

Which Llama model? It doesn't matter for the JSONL

ModelCommon 2026 useJSONL format
Llama 3.1 8B / 70BGeneral-purpose dev fine-tunesSame — ChatML or ShareGPT
Llama 3.2 1B / 3BEdge / on-deviceSame
Llama 3.2 11B / 90B VisionMultimodalChatML with image parts
Llama 3.3 70BProduction fine-tunes (QLoRA)Same
Llama 4 Scout / MaverickLong context, large MoESame

The chat template that wraps role/content into <|begin_of_text|>, <|start_header_id|>, etc. is applied by the trainer at tokenization time. Don't put those tokens in your JSONL. Just write clean role/content pairs and let the trainer's chat template do the wrapping.

What this validator checks

Common mistakes this validator catches

{"conversations":[{"from":"user","value":"Hi"},{"from":"assistant","value":"Hi"}]}
// Error: ShareGPT uses 'human'/'gpt', not 'user'/'assistant'.

{"messages":[{"role":"human","content":"Hi"}]}
// Error: ChatML uses 'user', not 'human'.

{"conversations":[{"from":"human","content":"Hi"}]}
// Error: ShareGPT uses 'value', not 'content'.

{"instruction":"Do X.","output":""}
// Error: Alpaca 'output' must be non-empty — it's the training target.

{"messages":[...], "conversations":[...]}
// Error: don't mix ChatML and ShareGPT in the same record.

Real error strings from the OSS training stack

ErrorSourceFix
ValueError: `type: sharegpt...` is deprecated. Please use `type: chat_template` instead. Axolotl ≥ 0.6 Convert conversationsmessages and set type: chat_template in your YAML.
ValueError: unhandled prompt tokenization strategy: sharegpt Axolotl Same — old configs; switch to chat_template.
KeyError: 'conversations' Unsloth standardize_sharegpt() Your file is already in messages shape — skip the standardize_sharegpt call.
RuntimeError: You're using assistant_only_loss=True, but at least one example has no assistant tokens. This usually means the tokenizer's chat template doesn't generate assistant masks — it may be missing the {% generation %} keyword. TRL SFTTrainer Every example must end with an assistant turn; use a chat template containing {% generation %}.
ValueError: Asking to pad but the tokenizer does not have a padding token Axolotl Set special_tokens.pad_token: <|finetune_right_pad_id|> or use eos_token.
ValueError: You should supply an encoding ... that includes input_ids, but you provided ['labels'] Axolotl Config / data mismatch — chat_template type pointed at instruct-style (Alpaca) data, or vice-versa.
messages must alternate user/assistant after optional system Together / Fireworks upload Fix consecutive same-role turns; merge or remove duplicates.
Silent training on whitespace (no error) Empty content / value This validator flags empty strings — TRL and Axolotl may warn but won't always error.

How to use it

  1. Pick the format your trainer expects. ChatML is the right default for 2026.
  2. Drop a .jsonl file or paste records.
  3. Click Validate. Each line is checked against the rules for the selected format.
  4. Inspect the Error List — line number and reason.
  5. Download valid examples only rebuilds a clean file with broken lines stripped.
  6. Need to switch formats? The fine-tune editor converts ChatML ↔ ShareGPT in one click.

Tips & common pitfalls

Troubleshooting

Which format should I use in 2026?

ChatML messages. Every modern trainer (TRL, Axolotl chat_template, Unsloth, LLaMA-Factory, Together, Fireworks, Replicate) accepts it. Convert legacy ShareGPT to ChatML once and stop worrying about it.

Axolotl says type: sharegpt is deprecated. What now?

Convert your conversations + from/value records to messages + role/content, and change your YAML to type: chat_template. The fine-tune editor does the conversion in bulk.

Unsloth crashes with KeyError: 'conversations'.

You're calling standardize_sharegpt(dataset) on a file that's already in messages shape. Skip that call — Unsloth accepts ChatML directly.

TRL says "no assistant tokens" / "missing {% generation %}".

The chat template you've picked doesn't emit the generation mask that assistant_only_loss=True requires. Either disable assistant-only loss, or use a chat template that includes {% generation %} markers (Llama 3's default does).

Do I need to include the <|begin_of_text|> and <|eot_id|> tokens?

No. Those are wrapping tokens applied by the tokenizer at training time. Your JSONL should have clean role/content; the chat template adds the wrapping.

Can I mix Alpaca and ChatML in one file?

No. The trainer iterates expecting a uniform shape. Convert Alpaca rows to ChatML — instruction + input become the user turn, output becomes the assistant turn.

Is my data uploaded?

Never. Everything runs in your browser. See the privacy policy.

Frequently asked questions

What format does Llama 3 fine-tuning use?

ChatML messages — the same shape OpenAI uses. {"messages": [{"role": "system|user|assistant|tool", "content": "..."}]}, one record per line.

ShareGPT or ChatML — which should I pick in 2026?

ChatML. ShareGPT is the older de-facto OSS format and still works, but Axolotl marks it deprecated and most platforms standardize on ChatML. If you have ShareGPT data, convert once and stop maintaining two paths.

How do I convert ShareGPT to ChatML / messages?

Rename top-level conversationsmessages; in each turn, rename fromrole and valuecontent; map humanuser and gptassistant. The fine-tune editor does this in bulk.

Does my JSONL need the <|begin_of_text|> and <|eot_id|> tokens?

No — the trainer's chat template adds them. Just write clean role/content pairs.

Is the format different for Llama 3.1 vs 3.3 vs Llama 4?

No. Same JSONL across all of them. The chat template (applied by the trainer at tokenization time) is what differs.

Can I include tool calls?

Yes, in ChatML mode. Use OpenAI-style tool_calls on the assistant turn with content: null, and a matching role: "tool" turn with the result. Axolotl, Unsloth, and TRL all accept this shape.

What's the minimum dataset size?

50–200 for quick experiments; ≥ 1,000 for production-quality fine-tunes. Quality matters more than quantity — 100 great examples beat 10,000 noisy ones.

ShareGPT vs Alpaca — what's the difference?

ShareGPT is multi-turn conversational (conversations array). Alpaca is single-turn instruction (instruction / input / output). Use ShareGPT for chat fine-tunes, Alpaca for "given this prompt, produce this output" tasks.

Related tools