Interface: ModelSpec

August 19, 2026 ยท View on GitHub

@sdeverywhere/build / ModelSpec

Interface: ModelSpec

Describes a model (e.g., a Vensim mdl or Stella stmx file) and the input/output variables that should be included in the model generated by SDEverywhere.

Aside from the inputs and outputs properties (which allow for richer InputSpec and OutputSpec forms here), the properties of this interface are shared with the ModelSpec type from the compile package, which describes the spec.json file format used by the lower-level sde commands.

Properties

inputs

inputs: string[] | InputSpec[]

The input variables for the model. This can either be a simple array of input variable names, or an array of InputSpec instances.

The builder requires only variable names for the purposes of generating a model, but some plugins may require full InputSpec instances.


outputs

outputs: string[] | OutputSpec[]

The output variables for the model. This can either be a simple array of output variable names, or an array of OutputSpec instances.


options?

optional options?: ModelSpec

Additional properties to include in the generated spec.json file.

Deprecated

All properties that are supported in a spec.json file are now declared directly on this interface, so it is no longer necessary to use this escape hatch. Any properties provided here will be merged into the resolved model spec (a property that is configured directly on this interface takes precedence over the same property provided here), but this property will be removed in a future release.


datFiles?

optional datFiles?: DatFileSpec[]

The dat files that provide the data for exogenous data variables in the model.

Each entry is resolved relative to the model directory (i.e., the directory that is passed using the --datadir argument, which defaults to the directory that contains the model file).


directData?

optional directData?: object

The mapping of data tag to Excel workbook file name, used to resolve the data for GET DIRECT DATA, GET DIRECT CONSTANTS, and GET DIRECT LOOKUPS calls in the model.

Each key is the tag that appears in the model equation (for example, ?data), and each value is the name of an xlsx file that is resolved relative to the model directory.

Index Signature

[dataTag: string]: string


dimensionFamilies?

optional dimensionFamilies?: object

The mapping of dimension name to family name, used when SDEverywhere cannot infer the family for a dimension from the model alone.

Both the keys and the values use the dimension names as they appear in the modeling tool (they are converted to canonical form when the spec file is read).

Index Signature

[dimName: string]: string


specialSeparationDims?

optional specialSeparationDims?: object

The mapping of variable identifier to the dimension(s) on which that variable should be separated into one variable instance per subscript.

Separating a variable is sometimes necessary to break a dependency cycle that would otherwise prevent the model from being evaluated. Each value can be either a single dimension identifier or an array of dimension identifiers.

Index Signature

[varId: string]: string | string[]


separateAllVarsWithDims?

optional separateAllVarsWithDims?: (string | string[])[]

The dimensions for which all variables should be separated into one variable instance per subscript.

This is a convenience alternative to specialSeparationDims that avoids the need to list each affected variable. Each entry can be either a single dimension identifier or an array of dimension identifiers; a variable is separated only if every dimension in the entry appears on the left-hand side of its equation.


bundleListing?

optional bundleListing?: boolean

Whether to bundle a model listing with the generated model.

If undefined, defaults to false.

When this is true, a model listing will be bundled with the generated model to allow the runtime package to resolve variables that are referenced by name or identifier. This listing will increase the size of the generated model, so it is recommended to set this to true only if it is needed.


customConstants?

optional customConstants?: boolean | string[]

Whether to allow constants to be overridden at runtime using setConstant.

If undefined or false, the generated model will implement setConstant as a no-op, meaning that constants cannot be overridden at runtime.

If true, all constants in the generated model will be available to be overridden.

If an array is provided, only those variable names in the array will be available to be overridden.


customLookups?

optional customLookups?: boolean | string[]

Whether to allow lookups to be overridden at runtime using setLookup.

If undefined or false, the generated model will implement setLookup as a no-op, meaning that lookups cannot be overridden at runtime.

If true, all lookups in the generated model will be available to be overridden.

If an array is provided, only those variable names in the array will be available to be overridden.


customOutputs?

optional customOutputs?: boolean | string[]

Whether to allow for capturing the data for arbitrary variables at runtime (including variables that are not configured in the outputVarNames array).

If undefined or false, the generated model will implement storeOutput as a no-op, meaning that the data for arbitrary variables cannot be captured at runtime.

If true, all variables in the generated model will be available to be captured at runtime.

If an array is provided, only those variable names in the array will be available to be captured at runtime.