Skip to main content

Crate zsfm_core

Crate zsfm_core 

Source

Structs§

VariateForecast

Enums§

ForecastOutput
ValidationError
Typed validation errors for request parsing. Callers at the CLI edge convert these to anyhow with context; library code can match on variants.

Constants§

MAX_CONTEXT_VALUES
Maximum total context values accepted per request (flat count).
MAX_HORIZON
Maximum forecast horizon steps accepted by infer commands.
MAX_STDIN_BYTES
Maximum stdin JSON payload accepted by infer commands (64 MiB).

Traits§

Forecaster
Common interface implemented by every GGUF-quantized zero-shot time-series forecaster in the workspace (Toto, Chronos, TimesFM, …). Lets the CLI and Python bindings dispatch across models without per-model glue code.

Functions§

forecast_response_json
Wrap one or more ForecastOutputs in the shared response envelope every model’s infer CLI subcommand (and later, Python binding) returns.
json_bool
json_f64
json_usize
parse_horizon
Parse and bound the horizon field of a forecast request.
parse_matrix
Parse a 2D numeric matrix for tabular infer requests.
parse_mv_contexts
Parse the context field of a forecast request into [batch][variate][time].
quantile_matrix_to_output
Turn one forecast’s QuantileMatrix into a ForecastOutput, choosing the univariate (flat point/quantiles) or multivariate (variates: [...]) shape based on how many variates the matrix actually has.
read_stdin_limited
Read stdin with a byte cap so a huge pipe cannot OOM before JSON parsing.
softmax
Numerically stable softmax over host f32 logits.
validate_contexts
Reject empty, oversized, or non-finite contexts before inference.
validate_horizon
Enforce 1 <= horizon <= MAX_HORIZON.

Type Aliases§

QuantileMatrix
[quantile_level][variate][horizon_step] — the output shape every zsfm time-series forecaster produces.