SPECIFICATION V2.0 OFFICIAL STANDARD
SillyTavern V2 Open Spec Technical Documentation
Technical specification defining the canonical JSON structure for SillyTavern V2 character cards, payload keys, macro substitutions, and PNG text chunk embeddings.
1. Root Object Structure
V2 character cards require a top-level wrapper with spec: "chara_card_v2" and spec_version: "2.0". All character attributes are encapsulated inside the data dictionary.
{
"spec": "chara_card_v2",
"spec_version": "2.0",
"data": {
"name": "Character Name",
"description": "Character Overview",
"personality": "W++ specs",
"scenario": "RP Scenario",
"first_mes": "First Message",
"mes_example": "<START>\n{{user}}: Hi\n{{char}}: Hello!",
"creator_notes": "Author Notes",
"system_prompt": "",
"post_history_instructions": "",
"tags": ["Fantasy", "Action"],
"creator": "Creator Name",
"character_version": "1.0",
"alternate_greetings": [],
"extensions": {}
}
}2. Reserved Macro Tokens
{{user}}: Dynamically replaced with the current user's display name.{{char}}: Dynamically replaced with the character'sdata.name.<START>: Delimits separate dialogue example turns insidemes_example.
3. Token Gauge Calculation Algorithm
For standard BPE tokenizers (e.g. Llama, Claude, GPT-4), the estimated token length is calculated using the weighted sum of character lengths across active prompt fields divided by a factor of 4.
Estimated Tokens = Math.round((description.length + personality.length + scenario.length + first_mes.length + mes_example.length) / 4)