ChatML vs Harmony: Understanding the new Format from OpenAI 🔍
Blog post from HuggingFace
OpenAI has introduced a new format called Harmony, designed for their gpt-oss models, which differs significantly from the existing ChatML format used in models like Qwen3. While ChatML employs an XML-inspired structure with clear conversational tags and has been widely utilized for its simplicity and clarity, Harmony offers a multi-channel architecture that categorizes messages into analysis, commentary, and final outputs, allowing for a more nuanced handling of reasoning and tool calls. Harmony employs a TypeScript-style syntax for tool definitions, which is more concise and familiar to developers compared to ChatML's JSON schemas. This new format not only facilitates clearer execution tracing through explicit message routing using a "to=" syntax but also introduces separate safety standards per channel, potentially enhancing the observability and safety of complex model behaviors. As the ecosystem evolves, understanding both formats is essential for building better inference infrastructure and leveraging the full capabilities of reasoning models.