Configuration File
The .pd4castrrc.json file is the central configuration for your model project.
It lives at the root of your model directory and defines everything the platform
needs to know about your model: its identity, inputs, outputs, sensitivities,
and scheduling behaviour. The CLI validates this file against a schema on every
command.
File Location and Format
The configuration file must be named .pd4castrrc.json and placed at the root
of your model project. It uses standard JSON format. You can generate a starter
config by running pd4castr init, which scaffolds a new project from a
template.
You can point the CLI to a different config file using the -c or --config
flag on any command:
pd4castr test -c .pd4castrrc.variant.jsonComplete Field Reference
Top-Level Fields
These fields define your model’s identity and global behaviour.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | Yes | — | Display name for the model. |
forecastVariable | string | Yes | — | The variable being forecast: "price", "expected_generation" or "price_spike_probability". |
timeHorizon | string | Yes | — | Forecast time horizon: "hour_ahead", "day_ahead", "week_ahead", "quarterly", "annual", or "historical". |
displayTimezone | string | No | Australia/Brisbane | IANA timezone string used for display in the pd4castr UI. |
public | boolean | No | false | Whether the model is visible to other organisations. |
runMode | string | No | "AUTOMATIC" | How runs are triggered: "AUTOMATIC" or "ON_DEMAND". See Run modes. |
runDatetimeQuery | string or null | No | null | Path to a SQL file for custom run datetime. See Custom run datetime. |
summary | string | No | "" | Terse description of the model, shown at the top of the model info page, below the model name (max 500 characters). |
description | string | No | — | Inline long-form Markdown description of the model, shown in the Description section of the model info page, below the summary. |
descriptionFile | string | No | — | Path to a Markdown file whose contents are inlined at publish time and shown the same way as description. Mutually exclusive with description. |
metadata | object | No | {} | Freeform key-value metadata (for example, resolution, feature lists), shown in the Raw training metadata section of the model info page. |
defaultComparisonModels | array of UUIDs | No | [] | Model group IDs used as default comparison selections in the pd4castr UI. See Default comparison models. |
axes | array | No | [] | Dimensions the model runs over. See Model axes. |
executor | object | No | — | The CPU, memory, ephemeral storage and timeout of each run. See Executor. |
The platform UI recognises several well-known keys in metadata when present:
resolution is used to build the model’s display name; features and
feature_importances (aligned arrays of strings and numbers) power the feature
importances panel; loss_function is shown as a training metadata attribute
alongside author, version, and training_period; links adds labelled URLs
(see Model links). Any other keys are preserved verbatim and
visible in the Raw training metadata section.
Model links
metadata.links is a list of labelled URLs shown in the Model Info dialog and
at the top of the model details card on the model info page. Each entry needs a
label and a url, and both must be non-empty; entries that aren’t are
skipped.
{
"metadata": {
"links": [
{
"label": "Retrospective reports",
"url": "https://pdview.com.au/blog?category=retrospective-reports&tags=week-ahead"
}
]
}
}A model that declares no links derives one from its horizon: week-ahead and
quarterly point at the blog listing for their cadence. Declaring links
replaces it.
Default comparison models
defaultComparisonModels lists the models used as default comparison selections
in the pd4castr UI, before a viewer picks anything. Entries are model group
IDs, and each resolves to the newest revision of that group, so a selection
keeps tracking the target model as its author republishes.
Find a model group ID in the $$modelGroupID field of the target model’s
.pd4castrrc.json, or as modelGroupId on any model returned by
GET /v1/model.
{
"defaultComparisonModels": ["828e98b1-9916-4a85-8a20-831fb2396845"]
}An entry is skipped when it names a group on a different time horizon, a group
you cannot see, or your own model’s group. Omit the field, or set it to [],
for no default selections.
The value is read at publish time, so a change only takes effect once you republish the model.
Inputs
The inputs array defines the data your model consumes. Each entry has the
following fields:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
key | string | Yes | — | Identifier for this input. Becomes INPUT_<KEY>_URL in the container. |
trigger | string | Yes | — | "WAIT_FOR_LATEST_FILE" or "USE_MOST_RECENT_FILE". |
file | string | Static inputs only | — | Path to the local file the CLI uploads, relative to the project root. |
fetcher | object | Fetched inputs only | — | Data fetcher configuration, with the fields below. |
storageLocation | string | No | — | ID of the storage location the input’s files land in. Defaults to pd4castr’s shared storage location. |
uploadFileFormat | string | No | "json" | Format of the uploaded file: "json", "csv", or "parquet". |
targetFileFormat | string | No | "json" | Format your container receives. Must match uploadFileFormat. |
axes | object | No | — | Connects the input to a model axis. See Model axes. |
sources | object | No | — | Several input sources, in place of file or fetcher. See Input sources. |
A fetcher block has these fields:
| Field | Type | Required | Description |
|---|---|---|---|
fetcher.type | string | Yes | The data fetcher type, for example "AEMO_MMS". |
fetcher.checkInterval | number | Yes | Seconds between runs of the check query. Minimum 5. pd4castr starts a check within a second of the interval ending; a 5-second interval runs the check query 12 times a minute against the provider’s database. |
fetcher.config.checkQuery | string | Yes | Path to a SQL file whose result changes whenever new data is available. |
fetcher.config.fetchQuery | string | One of fetchQuery or fetchQueries | Path to a SQL file that returns the data to write as the next input file. |
fetcher.config.fetchQueries | object | One of fetchQuery or fetchQueries | A map of query key to SQL file path, one file per query for each fetch (Several Fetch Queries). |
fetcher.statementTimeoutSeconds | number | No | Seconds the check query and each fetch query may run. Defaults to 10, with a maximum of 900. |
An input with several input sources declares a sources map in place of file,
fetcher, and storageLocation. Each entry is keyed by its input source key
and has these fields:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
file | string | Exactly one of file/fetcher | — | Path to the local file the CLI uploads, relative to the project root. |
fetcher | object | Exactly one of file/fetcher | — | Data fetcher configuration, with the fields above. |
storageLocation | string | No | — | ID of the storage location this input source’s files land in. |
uploadFileFormat | string | No | the input’s uploadFileFormat | Format of this input source’s files. |
A sources map with a single entry gives the input one input source that is
still connected to its source-binding axis, so its runs carry the input source
key and the app shows the axis. Use it to publish with one data provider while
more are planned.
See Model inputs for detailed explanations, and Input sources for inputs with several input sources.
Datasets
The datasets array defines reference data published alongside the model. Each
entry has the following fields:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
key | string | Yes | — | Identifier for this dataset. Used as the table name when the dataset is queried. |
file | string | Yes | — | Path to the local file the CLI uploads, relative to the project root. |
fileFormat | string | No | inferred | "json", "csv", or "parquet". Inferred from the file extension when omitted. |
storageLocation | string | No | — | ID of the storage location your dataset’s files land in. By default, the platform’s shared storage location is used. |
axes | object | No | — | Maps an axis to the column this file is partitioned by. Parquet datasets only. See Model axes. |
See Model datasets for detailed explanations.
Outputs
outputs is a map from an output key you choose, such as forecast, to an
output. Each output describes one file your model uploads on each run, and its
shape sets its kind. The one output whose shape is "wide" or "long" is
the forecast output, which your model uploads to OUTPUT_URL. Every output
whose shape is "table" is a table output.
A "wide" output holds one row per forecast_datetime, with one column for
each value the model forecasts at that time, and the forecast chart plots it. A
"long" output holds one row per forecast_datetime and combination of
dimension values.
A "table" output holds rows with no forecast_datetime, such as one row per
region with the region’s id and name. Your model uploads each table output to
the URL in its own OUTPUT_<KEY>_URL environment variable, as
Table outputs describes.
An output key starts with a lowercase letter or a digit and continues with
lowercase letters, digits, - and _. Give each output a key that no input or
dataset of the model uses. The CLI rejects two table output keys that differ
only in - and _, such as unit-groups and unit_groups, because both
upload to OUTPUT_UNIT_GROUPS_URL.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
shape | string | Yes | — | "wide", "long", or "table". |
fileFormat | string | Yes | — | "json", "csv", or "parquet". |
dimensions | array | In "long" only | — | One entry per dimension, with the fields in the table below. |
primaryKey | array | No | — | In "table" only: the keys of the columns whose values together identify each row. |
columns | array | Yes | — | One entry per column, with the fields in the tables below. |
Column fields
List every column of the file in columns except forecast_datetime. In a
"long" output, leave the dimensions out of columns as well. Each entry of a
"wide" or "long" output’s columns has these fields:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | Yes | — | The column’s name in the pd4castr UI. |
key | string | Yes | — | The column’s name in the output file, unique in the output. |
type | string | Yes | — | "float", "integer", "string", "date", or "boolean". |
seriesKey | boolean | In "wide" only | — | true to plot the column as a line on the forecast chart. |
colour | string | No | — | The line’s colour, as a hex code such as "#84EDDC". |
unit | string | No | — | The column’s unit, such as "MW", shown on the forecast chart and table. At most 32 characters. |
A "long" output’s columns take neither seriesKey nor colour, and the CLI
rejects a column that sets either.
Dimension and table column fields
Each entry of a "long" output’s dimensions has these fields:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
key | string | Yes | — | The dimension’s column in the output file, unique in the output. |
type | string | Yes | — | "string", "integer", or "boolean". |
values | array | No | — | The only values a row may hold, each of the dimension’s type. |
describedBy | string | No | — | The key of a "table" output that lists the dimension’s values. |
labelColumn | string | No | — | The column of the describedBy output that holds each value’s label. |
The CLI rejects a dimension that sets only one of describedBy and
labelColumn. It also rejects a describedBy output whose primaryKey isn’t
exactly one column, because that column holds the dimension’s values.
Each entry of a "table" output’s columns has these fields:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
key | string | Yes | — | The column’s name in the output file, unique in the output. |
type | string | Yes | — | "float", "integer", "string", "date", or "boolean". |
name | string | No | — | A readable name for the column, which the CLI prints in its summary. |
references | string | No | — | "<output_key>.<column_key>" of the primaryKey column whose values it holds. |
{
"outputs": {
"forecast": {
"shape": "wide",
"fileFormat": "json",
"columns": [
{
"name": "NSW1",
"key": "nsw1",
"type": "float",
"seriesKey": true,
"colour": "#84EDDC"
}
]
}
}
}Configs with an outputs list
Configs written for CLI releases before the outputs map declare outputs as a
list of columns, with the file format in a top-level outputFileFormat field.
The CLI reads such a config as one "wide" output under the key forecast,
with the list’s columns. The output’s fileFormat is the config’s
outputFileFormat, or "json" when the config has none.
The next pd4castr publish writes the converted outputs back to
.pd4castrrc.json and drops outputFileFormat. On a model you have published,
pd4castr test and pd4castr fetch write it back too. Until one of those
commands writes it back, the file keeps its list, and the CLI converts the list
each time it reads the file.
If an input or a dataset in your config has the key forecast, the converted
output would share it, so the command that would write the map back fails before
it writes the file or publishes anything. Replace outputs and
outputFileFormat with an outputs map whose output has another key to fix it.
If pd4castr rejects a publish because of the outputs list, upgrade
@pd4castr/cli and publish again.
See Model outputs for how the platform reads and plots an output.
Sensitivities
The sensitivities array defines alternative scenario runs. Each entry has the
following fields:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | Yes | — | Display name for the scenario, shown in the pd4castr UI. |
key | string | Yes | — | Stable identifier for this sensitivity. Must be lowercase alphanumeric (with hyphens/underscores). Must be unique within the model. |
query | string | Yes | — | Path to a SQL file that transforms the input data. |
See Sensitivities for detailed explanations.
Input Aggregations
The inputAggregations array defines summary views of input data displayed
below the forecast chart.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | Yes | — | Display name for the aggregation chart. |
key | string | Yes | — | Stable identifier for this aggregation, tracked across revisions. Must be lowercase alphanumeric (with hyphens/underscores). Must be unique within the model. |
query | string | Yes | — | Path to a SQL file that aggregates input data. |
description | string | No | "" | Tooltip text shown in the pd4castr UI when hovering over the chart title. |
colours | string[] | No | [] | Array of hex colour strings for chart series. |
See Input aggregations for detailed explanations.
Views
The views array defines custom model run views: parameterized reports that
visualize a run’s output as a chart or table in the pd4castr UI. Each view runs
a SQL query over the run output and supporting data.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
key | string | Yes | — | Unique identifier for the view. Lowercase alphanumeric, with hyphens/underscores. |
name | string | Yes | — | Display name for the view, shown in the pd4castr UI. |
sql | string | Yes | — | Path to the view’s SQL file. |
params | object | No | {} | Map of parameter name to parameter configuration. |
columns | array | Yes | — | Metadata for each column the query returns. |
Each entry in params supports type (string, number, or boolean),
optional, control (select), options (path to an options SQL file),
defaultFrom, and sample. Each entry in columns supports key, role
(dimension or measure), label, unit, and format.
See Model run views for detailed explanations.
Executor
The executor object sets the CPU, memory, ephemeral storage and timeout of
each run of the model. Set its type to "fargate": pd4castr runs every model
as a task on AWS Fargate, Amazon’s service for running containers. pd4castr
gives each field you leave out the platform default.
executor needs a version of the CLI that supports it, so
update the CLI before you add one. When
you republish from an older CLI, the CLI leaves executor out, which clears the
model’s executor and returns its runs to the platform defaults.
"executor": {
"type": "fargate",
"timeoutSeconds": 900,
"cpu": 4096,
"memory": 16384,
"ephemeralStorageGiB": 50
}| Field | Type | Required | Default | Description |
|---|---|---|---|---|
type | string | Yes | — | "fargate". |
timeoutSeconds | number | No | 600 | Seconds a run may take before pd4castr stops it. |
cpu | number | With memory | 256 | CPU units, where 1024 units make 1 vCPU. |
memory | number | With cpu | 512 | Memory in MB. |
ephemeralStorageGiB | number | No | 20 | Ephemeral storage, the container’s disk space, in GiB. Fargate’s default is 20 GiB, and a value raises it to between 21 and 200. |
cpu and memory must form one of these pairs (CPU units / MB): 256/512,
256/1024, 256/2048, 512/1024, 512/2048, 1024/2048, 1024/4096, 2048/4096,
2048/8192, 4096/8192, 4096/16384, 8192/16384, 8192/32768 and 16384/32768. Set
cpu and memory together or leave both out. The CLI rejects a config that
sets only one of them, or a pair outside that list.
pd4castr caps an executor at 16384 CPU units, 32768 MB and a timeout of 1800 s, and rejects a publish that asks for more.
pd4castr passes each run the locations of its input files and its outputs as
signed URLs that expire, in environment variables such as INPUT_<KEY>_URL,
OUTPUT_URL and OUTPUT_<KEY>_URL. pd4castr signs each URL to expire 15
minutes after the run’s timeout, and no sooner than 30 minutes, so a run that
takes its full timeout can still upload its output.
File Paths
All file paths in the configuration are relative to the project root. This
includes query paths (fetcher queries, sensitivity queries, input aggregation
queries, view queries, view options queries, and runDatetimeQuery) and the
descriptionFile Markdown path. See SQL queries for
the SQL dialect each query is written in.
Full Example
Here’s a complete .pd4castrrc.json for a day-ahead price forecast model with
fetched inputs, output series, and input aggregations:
{
"name": "Day Ahead Price Forecast",
"forecastVariable": "price",
"timeHorizon": "day_ahead",
"displayTimezone": "Australia/Brisbane",
"public": false,
"runMode": "AUTOMATIC",
"runDatetimeQuery": "queries/run-datetime.sql",
"summary": "30-minute day-ahead electricity price forecast",
"descriptionFile": "docs/description.md",
"metadata": {
"resolution": "30min"
},
"defaultComparisonModels": ["828e98b1-9916-4a85-8a20-831fb2396845"],
"inputs": [
{
"key": "dispatch_price",
"trigger": "WAIT_FOR_LATEST_FILE",
"uploadFileFormat": "json",
"targetFileFormat": "json",
"fetcher": {
"type": "AEMO_MMS",
"checkInterval": 300,
"config": {
"checkQuery": "queries/data-fetchers/dispatch-price-check.sql",
"fetchQuery": "queries/data-fetchers/dispatch-price-fetch.sql"
}
}
},
{
"key": "regional_boundaries",
"file": "test_input/regional_boundaries.csv",
"trigger": "USE_MOST_RECENT_FILE",
"uploadFileFormat": "csv",
"targetFileFormat": "csv"
}
],
"datasets": [
{
"key": "duid_info",
"file": "datasets/duid_info.parquet"
}
],
"outputs": {
"forecast": {
"shape": "wide",
"fileFormat": "json",
"columns": [
{
"name": "NSW1",
"key": "nsw1",
"type": "float",
"seriesKey": true,
"colour": "#84EDDC"
},
{
"name": "QLD1",
"key": "qld1",
"type": "float",
"seriesKey": true,
"colour": "#FD4E4E"
},
{
"name": "SA1",
"key": "sa1",
"type": "float",
"seriesKey": true,
"colour": "#FED600"
},
{
"name": "TAS1",
"key": "tas1",
"type": "float",
"seriesKey": true,
"colour": "#40A967"
},
{
"name": "VIC1",
"key": "vic1",
"type": "float",
"seriesKey": true,
"colour": "#1965C6"
}
]
}
},
"sensitivities": [
{
"name": "High Demand (+10%)",
"key": "high-demand",
"query": "queries/sensitivities/high-demand.sql"
}
],
"inputAggregations": [
{
"name": "Native Demand",
"key": "native-demand",
"query": "queries/input-aggregations/native-demand.sql",
"description": "Regional demand by demand_and_nonshedgen",
"colours": ["#008000", "#009900", "#00B300", "#00CC00", "#00E600"]
}
]
}Next Steps
- Model inputs — Detailed guide to input configuration and data fetchers.
- Model datasets — Detailed guide to publishing reference data alongside your model.
- Model outputs — How to define your output schema.
- Sensitivities — Scenario analysis and input aggregations.
- Testing your model — Local validation workflow.
- Publishing — How to ship your model.
- Run modes and scheduling — Automatic and on-demand triggering.