Model Inputs
Every model receives its input data as files, served to the Docker container via
environment variables. Each input you define in your .pd4castrrc.json becomes
an INPUT_<KEY>_URL environment variable that your model must fetch with a
standard HTTP GET request. Inputs can be uploaded manually (static) at publish
time or fetched automatically from external data sources (fetched).
How Inputs Work
When a model run starts, the platform makes each input file available at a
unique URL. Your model must read these URLs from environment variables and
download the data. The environment variable name is derived from the input’s
key field, converted to uppercase. For example, an input with
"key": "demand" becomes INPUT_DEMAND_URL.
Your model code fetches the file from that URL, parses it, and uses it as input data for your forecasting logic.
Input Configuration Fields
Each entry in the inputs array in .pd4castrrc.json supports the following
fields.
| Field | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Identifier for this input. Becomes the environment variable name (INPUT_<KEY>_URL). |
trigger | string | Yes | How new data triggers runs: WAIT_FOR_LATEST_FILE or USE_MOST_RECENT_FILE. |
uploadFileFormat | string | No | Format of the uploaded file: json, csv, or parquet. Defaults to json. |
targetFileFormat | string | No | Format served to the container. If it differs from uploadFileFormat, the platform converts the file automatically. |
inputSource | string | No | ID of your desired input source. By default, the platform’s shared source is used. |
fetcher | object | No | Data fetcher configuration. Omit this field for static inputs. See Fetched inputs. |
Static Inputs
Static inputs are files you can upload automatically at publish time. They’re ideal for reference data, lookup tables, or configuration files that don’t change with every model run.
Static input files live in your project’s test_input/ directory. When you run
pd4castr publish, the CLI uploads these files to the configured input source.
A minimal static input configuration looks like this:
{
"key": "reference_prices",
"trigger": "USE_MOST_RECENT_FILE",
"uploadFileFormat": "csv",
"targetFileFormat": "csv"
}If you want to upload static input data outside of the publish flow to trigger a model run, you can contact us about having access to your own input source.
Dynamic Inputs (Data Fetchers)
Dynamic inputs pull data automatically from external sources on a schedule. This is useful for models that need fresh data without manual intervention.
By default, pd4castr provides an AEMO MMS data fetcher, which facilitates building forecasting models that consume Australian energy market data.
pd4castr supports integration with custom data sources. We can adapt to your
preferred technology or process. To learn more,
contact us to connect your data source.
To configure a dynamic input, add a fetcher block to the input entry:
{
"key": "predispatch_price",
"trigger": "WAIT_FOR_LATEST_FILE",
"uploadFileFormat": "json",
"targetFileFormat": "json",
"fetcher": {
"type": "AEMO_MMS",
"checkInterval": 300,
"config": {
"checkQuery": "queries/data-fetchers/predispatch-price-check.sql",
"fetchQuery": "queries/data-fetchers/predispatch-price-fetch.sql"
}
}
}The fetcher fields are:
| Field | Type | Description |
|---|---|---|
type | string | The data source type, for example, AEMO_MMS. |
checkInterval | number | How often (in seconds) to poll for new data. Minimum value is 60. |
config.checkQuery | string | Path to a SQL file containing a query that returns a “check”, used for determining whether new data is available. |
config.fetchQuery | string | Path to a SQL file containing a query that retrieves the data when new data is detected. |
The platform runs the check query at the configured interval. When the results differ from the previous check, it executes the fetch query and writes the output to storage. This new data can then trigger an automatic model run.
Trigger Types and Run Modes
Each input has a trigger that controls how it interacts with
automatic model runs:
WAIT_FOR_LATEST_FILE— The platform waits until this input has received new data before triggering a run. All inputs with this trigger type must have fresh data before the run starts.USE_MOST_RECENT_FILE— The platform uses whatever data was last available for this input. It doesn’t block a run from starting.
For models with runMode set to AUTOMATIC, the platform monitors all inputs.
A run is triggered only when every WAIT_FOR_LATEST_FILE input has received new
data. USE_MOST_RECENT_FILE inputs are included in the run using their most
recently available file.
Example Configuration
Here’s a complete inputs array with both a static and a fetched input:
{
"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_historical_prices",
"trigger": "USE_MOST_RECENT_FILE",
"uploadFileFormat": "csv",
"targetFileFormat": "csv"
}
]
}In this example, dispatch_price is fetched automatically from AEMO every 5
minutes. regional_historical_prices is a static CSV file uploaded during
publish. The model won’t run automatically until fresh dispatch price data
arrives, but it uses the latest available regional historical prices data.
Next Steps
- Use
pd4castr fetchto pull live data from your configured fetchers into your localtest_input/directory. - See the Configuration File reference for the full schema.