Chat Format Converter
Convert between OpenAI, Anthropic, and Llama chat formats
Format Converter
Related Tools
Dataset Splitter
Split datasets into train, validation, and test sets with stratification
JSONL Converter
Convert between JSON and JSONL formats for fine-tuning comparisons
PII Detector
Identify and redact Personally Identifiable Information in datasets client-side
Synthetic Data Generator
Generate synthetic examples based on schema instructions
Training Data Formatter
Format text for various training objectives (Fill-in-middle, Next Token)
Annotation Converter
Convert between different data annotation formats (COCO, YOLO, Pascal VOC)
What is Chat Format Conversion?
Different LLM providers use different formats for multi-turn conversations. OpenAI uses a messages array with role/content objects, Anthropic separates the system prompt, and Llama 2 uses special tokens like [INST] and <<SYS>>.
Whether migrating between providers, building multi-LLM apps, or preparing fine-tuning data, this tool saves hours of manual conversion.
Format Differences
OpenAI / ChatML
Messages array with role (system/user/assistant). System is part of array.
Anthropic
System as separate top-level field. Messages has only user/assistant.
Llama 2
Template with [INST], [/INST], <<SYS>>, <</SYS>> tokens.
Use Cases
- Multi-provider apps: Switch between OpenAI, Anthropic, and open-source seamlessly.
- Fine-tuning prep: Convert logs to required training format.
- Testing: Compare responses across providers with same prompts.
FAQ
Do format differences affect behavior?
Yes. Anthropic's separate system field has different caching. Llama's template affects tokenization.
What about function calling?
This handles standard chat. Function calling differs significantly and needs separate handling.
