Llama Fine-Tune JSONL Validator
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.
Validate
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 / platform | Default format | Notes |
|---|---|---|
HuggingFace TRL SFTTrainer | ChatML messages | Apply chat template via tokenizer. |
| Axolotl (≥ 0.6) | ChatML messages (type: chat_template) | type: sharegpt is deprecated in 0.6+. |
| Unsloth | ChatML messages | ShareGPT works after standardize_sharegpt(). |
| LLaMA-Factory | ChatML messages | Configured via dataset_info.json. |
| Together AI | ChatML messages | OpenAI-compatible shape. |
| Fireworks | ChatML messages | OpenAI-compatible shape. |
| Replicate | ChatML messages | OpenAI-compatible shape. |
| SageMaker JumpStart | ChatML messages | For Llama 3 fine-tune templates. |
| Community datasets (OpenHermes, WizardLM, Glaive) | ShareGPT | Convert to ChatML for modern trainers. |
| Stanford Alpaca / Dolly / classic instruction | Alpaca | Single-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
| Model | Common 2026 use | JSONL format |
|---|---|---|
| Llama 3.1 8B / 70B | General-purpose dev fine-tunes | Same — ChatML or ShareGPT |
| Llama 3.2 1B / 3B | Edge / on-device | Same |
| Llama 3.2 11B / 90B Vision | Multimodal | ChatML with image parts |
| Llama 3.3 70B | Production fine-tunes (QLoRA) | Same |
| Llama 4 Scout / Maverick | Long context, large MoE | Same |
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
- ChatML mode:
messagesarray with valid roles (system,user,assistant,tool), at least one assistant turn, non-emptycontent(or validtool_callswithcontent: null), no mixing withconversations. - ShareGPT mode:
conversationsarray with validfromvalues (system,human,gpt,tool), at least onegptturn, non-emptyvalue, no mixing withmessages. - Alpaca mode: non-empty
instructionstring, optionalinputstring, non-emptyoutputstring. No extra top-level keys allowed. - Each line is valid JSON, one object per line.
- UTF-8 encoding, no BOM, no trailing-only newline.
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
| Error | Source | Fix |
|---|---|---|
ValueError: `type: sharegpt...` is deprecated. Please use `type: chat_template` instead. |
Axolotl ≥ 0.6 | Convert conversations → messages 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
- Pick the format your trainer expects. ChatML is the right default for 2026.
- Drop a
.jsonlfile or paste records. - Click Validate. Each line is checked against the rules for the selected format.
- Inspect the Error List — line number and reason.
- Download valid examples only rebuilds a clean file with broken lines stripped.
- Need to switch formats? The fine-tune editor converts ChatML ↔ ShareGPT in one click.
Tips & common pitfalls
- Don't put chat-template tokens in your JSONL. The
<|begin_of_text|>,<|start_header_id|>user<|end_header_id|>,<|eot_id|>markers are added by the trainer's tokenizer. If you bake them in yourself, you'll double-wrap and the model will train on the literal tokens. - ShareGPT in Axolotl 0.6+ is deprecated. The format still parses but only via the new
chat_templatepath. New projects should use ChatML. - Alpaca is single-turn only. If your dataset has multi-turn conversations, use ChatML — Alpaca can only express
instruction → output. - Llama version doesn't change the JSONL. 3.1, 3.2, 3.3, 4 — all the same shape. The trainer picks the right chat template based on the model.
- Don't mix formats in one file. Trainers iterate line by line and assume a uniform shape. Mixed files fail with cryptic indexing errors.
- Empty strings train on whitespace. The trainer may not error, but you'll waste compute and the model will pick up the noise. This validator flags empties.
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 conversations → messages; in each turn, rename from → role and value → content; map human → user and gpt → assistant. 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.