Data Schemas (JSON)
Field-by-field specification for all JSON data files under data/.
presets.json
Top-level structure with two arrays:
{ "models": [...], "loras": [...] }
See Configuration for the full model and LoRA field reference.
llm_models.json
LLM model configurations for text generation.
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
HuggingFace identifier (e.g., |
|
string |
Yes |
Display name (e.g., “Qwen 2.5 7B”) |
|
string |
No |
Capabilities or use-case notes |
|
bool |
Yes |
Whether model is available for selection |
|
bool |
Yes |
Whether to use 4-bit quantization |
Example:
{
"model_id": "Qwen/Qwen2.5-7B-Instruct",
"name": "Qwen 2.5 7B",
"notes": "Strong multilingual, best for CJK languages",
"is_active": true,
"load_in_4bit": true
}
regions.json
Geographic regions for adaptation targeting.
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Region code (e.g., |
|
string |
Yes |
Full name (e.g., “North America”) |
|
string |
No |
Regional description |
|
array |
Yes |
|
|
bool |
Yes |
Whether region is available |
countries.json
Countries with default language references.
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
ISO 3166-1 alpha-2 code (e.g., |
|
string |
Yes |
Full country name |
|
string |
Yes |
FK to |
|
array |
Yes |
|
|
string |
No |
Additional notes |
|
bool |
Yes |
Whether country is available |
languages.json
Languages with LLM model references.
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
IETF BCP 47 code (e.g., |
|
string |
Yes |
Full name with region (e.g., “English (United States)”) |
|
string |
Yes |
2-letter base code (e.g., |
|
string |
Yes |
FK to |
|
array |
Yes |
Array of alternative |
|
array |
Yes |
|
|
string |
No |
Additional notes |
|
bool |
Yes |
Whether language is available |
country_regions.json
Many-to-many mapping between countries and regions.
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
FK to |
|
string |
Yes |
FK to |
A country can belong to multiple regions (e.g., Australia maps to both ANZ and APAC).
country_languages.json
Many-to-many mapping between countries and languages.
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
FK to |
|
string |
Yes |
FK to |
|
bool |
Yes |
Whether this is the country’s primary language |
Multilingual countries have multiple entries with typically one marked is_primary: true.
prompt_templates.json
Jinja2 prompt templates for LLM interactions.
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Unique identifier (e.g., |
|
string |
Yes |
Display name |
|
string |
Yes |
One of: |
|
string |
Yes |
What the template does |
|
string |
Yes |
Jinja2 template body with |
|
object |
Yes |
Variable schema (currently |
|
int |
Yes |
Auto-incrementing version number |
See Prompt Template Editing for template editing and versioning.
segments.json
Audience segments across three categories.
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
|
|
string |
Yes |
Segmentation dimension (e.g., “Household Income”, “Usage Pattern”) |
|
string |
Yes |
Position on the dimension (e.g., “Middle-Income”, “First-Time Users”) |
|
string |
No |
Segment description |
|
array |
No |
|
|
bool |
Yes |
Whether segment is available |
The composite (category, vector, value) must be unique.
personas.json
Audience personas combining geographic and segment targeting.
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Persona name (e.g., “Budget-Conscious First-Timer”) |
|
string |
No |
Persona description |
|
string |
No |
FK to |
|
string |
No |
FK to |
|
string |
No |
FK to |
|
bool |
Yes |
Whether persona is available |
persona_segments.json
Many-to-many mapping between personas and segments.
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
FK to |
|
string |
Yes |
Segment category (e.g., |
|
string |
Yes |
Segment vector (e.g., “Household Income”) |
|
string |
Yes |
Segment value (e.g., “Middle-Income”) |
|
int |
No |
Display ordering within the persona |
brands.json
Brand reference data for the brand evaluation gate.
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Unique identifier (e.g., |
|
string |
Yes |
Display name |
|
string |
No |
Brand overview and positioning |
|
string |
No |
Free-text brand voice, values, visual identity rules |
|
array |
No |
|
|
bool |
Yes |
Whether brand is available |
See Brand Configuration for usage in the evaluation gate.
example_tvspot.json
TV spot import format used by import_tvspot.
Top-Level Fields
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Client or advertiser name |
|
string |
Yes |
Brand name |
|
string |
Yes |
Campaign or script title |
|
number |
Yes |
Total spot duration in seconds |
|
string |
Yes |
Unique job identifier (e.g., |
|
string |
Yes |
Language code (e.g., |
|
string |
No |
Production notes |
|
array |
Yes |
Array of script row objects |
Script Row Fields
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Shot identifier (e.g., |
|
string |
Yes |
Timecode in |
|
number |
Yes |
Shot duration in seconds |
|
string |
Yes |
Scene description (framing, setting, talent, on-screen text) |
|
string |
Yes |
Audio specification (SFX, MUSIC, VO, DIALOGUE) |
See Importing TV Spots (JSON) for import instructions and validation rules.
Insights Schema
Multiple models share a common insights structure:
[
{
"heading": "Section Title",
"points": [
"First point",
"Second point"
]
}
]
Used by: Region, Country, Language, Segment, and Brand models. The compose_insights() function in src/cw/lib/insights.py aggregates insights from multiple sources in hierarchical order.
Relationship Diagram
erDiagram
LLM_MODELS ||--o{ LANGUAGES : "primary_model"
REGIONS ||--o{ COUNTRY_REGIONS : ""
COUNTRIES ||--o{ COUNTRY_REGIONS : ""
COUNTRIES ||--o{ COUNTRY_LANGUAGES : ""
LANGUAGES ||--o{ COUNTRY_LANGUAGES : ""
COUNTRIES }o--|| LANGUAGES : "default_language"
PERSONAS }o--o| REGIONS : "region_code"
PERSONAS }o--o| COUNTRIES : "country_code"
PERSONAS }o--o| LANGUAGES : "language_code"
PERSONAS ||--o{ PERSONA_SEGMENTS : ""
SEGMENTS ||--o{ PERSONA_SEGMENTS : ""