Chat Markup Language
Also written: ChatML
Chat Markup Language (ChatML) structures conversations for AI models, especially OpenAI's.
Chat Markup Language, or ChatML, is a way to format text so that AI models can understand the different parts of a conversation. Think of it like using different colored pens to mark who said what: the user, the AI, or system instructions.
This helps the AI keep track of the conversation's flow and respond appropriately. For example, a user might say "Hello!" and the AI's response might be formatted with special tags to show it's the AI speaking.
ChatML is a structured format developed by OpenAI to delineate roles within a conversational exchange for their language models. It uses specific tokens to mark system messages, user messages, and assistant messages, enabling models to better understand context and turn-taking. This structured input is crucial for fine-tuning models and for providing clear prompts during inference, particularly for models like GPT-3.5 Turbo and GPT-4.
OpenAI's recent API announcements highlight the importance of structured data formats like ChatML for efficient model interaction. As more developers integrate AI into applications, standardized ways to represent conversations become essential for reliable performance and cost-effectiveness.
- Introducing ChatGPT and Whisper APIsOpenAI · OpenAI News ·
- OpenAI ChatGPT
- OpenAI developed ChatML to structure conversational data for their ChatGPT models, making it easier to integrate them via API.
Chat Markup Language was introduced by OpenAI as a specific format for structuring chat data to be used with their models. Source ↗
When using OpenAI's API playground, you can experiment with different ChatML structures. Try sending a message with a system prompt, then a user message, and see how the AI's response changes based on the defined roles.
The Playbook: reusable how-tos, prompts, configs and tips pulled out of the news.
- PromptRole-play a student struggling with math for AI tutor simulationSimulate a student's math struggles and uncertainty for AI tutor evaluation. · 5 min
- TemplateReusable workflow templates for healthcare teamsTeams can create and share templates for common workflows like documentation or prior authorizations. · 15 min
- TemplateTemplate for building an AI tool tailored to your workA structured approach to defining and building a custom AI tool for specific business needs. · 15 min
- TemplateEvals CSV prompt list for agent skillsA CSV file template for listing prompts used in evaluating agent skills. · 20 min
- HeuristicDouble coding agent task completion with docs linksProviding coding agents with a documentation link significantly increases their task completion rate. · 2 min
Questions people ask
- What are the main roles in ChatML?
- The main roles are system, user, and assistant. The system role sets the AI's behavior, the user role is for human input, and the assistant role is for the AI's output.
- Why is ChatML important for developers?
- ChatML provides a clear and consistent way to format conversations, which helps developers build more reliable and predictable AI applications using models like ChatGPT.
First seen on Subvolts Apr 24, 2024. Updated Sep 15, 2026. Written by an AI model from the items above and reviewed against them weekly; report an error.

