Chat Format Converter

Convert between OpenAI, Anthropic, and Llama chat formats

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.