Google Gemini Fine-Tune JSONL Validator
Your training data never leaves this tab. Vertex AI uploads your file when a job starts; this pre-flight check is fully local.
Validate
Gemini Fine-Tune JSONL Validator
Validate your Gemini supervised-tuning file against Vertex AI's actual shape: a contents array starting with a user turn, strict user/model alternation (note: it's "model", not "assistant"), and every entry's parts array containing at least one part with text or an inlineData / fileData object. An optional top-level systemInstruction with its own parts is supported. 100% in-browser.
Validating a different provider? OpenAI, Anthropic (Claude), Llama / ShareGPT, Mistral.
Gemini's shape, in one line
{
"systemInstruction": {"role": "system", "parts": [{"text": "You are helpful."}]},
"contents": [
{"role": "user", "parts": [{"text": "Hi"}]},
{"role": "model", "parts": [{"text": "Hello"}]}
]
}
Two things to remember:
- The assistant role is called
model. Notassistant, notbot. Wrong role name is the #1 error this validator catches. - Content lives in
parts, not as a string. Even a plain text message is"parts": [{"text": "..."}], an array.
What the validator checks
- Each line is valid JSON.
- Top-level
contentsis present and is an array. - Optional
systemInstructionis an object with its ownpartsarray. - First entry role is
user. - Roles strictly alternate user / model.
- Every
partsis a non-empty array; every part has eithertext,inlineData, orfileData. - No
assistantrole anywhere (common copy-paste from OpenAI samples).
Common mistakes I catch
{"contents": [{"role": "assistant", "parts": [{"text": "broken"}]}]}
// Error: Gemini uses 'model', not 'assistant'.
{"contents": [{"role": "user", "parts": {"text": "Hi"}}]}
// Error: 'parts' must be an array.
{"contents": [{"role": "user", "content": "Hi"}]}
// Error: Gemini uses 'parts', not 'content'.
Multi-modal parts
Inline images use inlineData with a mime type and base64 data:
{"contents": [
{"role": "user", "parts": [
{"inlineData": {"mimeType": "image/jpeg", "data": "..."}},
{"text": "What is this?"}
]},
{"role": "model", "parts": [{"text": "A cat."}]}
]}
Frequently asked questions
Where do I run the fine-tune job?
Vertex AI's supervised tuning console or the gcloud ai CLI. This file format is what their job runner reads — passing the OpenAI shape will fail at upload time.
What about the Generative Language API (AI Studio) format?
It's the same contents+parts shape, just a different endpoint. This validator works for both.
Is my data uploaded?
Never. Everything runs in your browser. See the privacy policy.