Moirai-1.0-R-large (Salesforce) β GGUF
β οΈ Non-commercial license. These weights are CC-BY-NC-4.0 β see License below before using them in any commercial product or service.
GGUF conversion of Salesforce's Moirai-1.0-R-large β a universal forecasting foundation model. Converted and run with zsfm, a Rust workspace that ports zero-shot forecasting and tabular foundation models to GGUF + candle. No PyTorch, no Python runtime required to run inference.
| F32 | F16 | Q8_0 |
|---|---|---|
moirai-f32.gguf |
moirai-f16.gguf |
moirai-q8.gguf |
F16 is generally the best size/accuracy trade-off; Q8_0 is smallest. This repo's default recommendation matches the upstream conversion default: F32.
Context must be at least 32 timesteps (Moirai pads short contexts up to a full patch rather than rejecting them, but 32 gives a meaningful example) β a shorter context fails with context too short. The examples below use a 32-value context.
Use it
Python (pip install zsfm)
pip install zsfm huggingface_hub
import zsfm
from huggingface_hub import hf_hub_download
gguf_path = hf_hub_download("amaye15/moirai-gguf", "moirai-f32.gguf")
model = zsfm.MoiraiModel(gguf_path)
context = [0.85, 0.93, 1.01, 1.09, 1.17, 1.25, 1.33, 1.06, 1.14, 1.22, 1.3, 1.38, 1.46, 1.54, 1.27, 1.35, 1.43, 1.51, 1.59, 1.67, 1.75, 1.48, 1.56, 1.64, 1.72, 1.8, 1.88, 1.96, 1.69, 1.77, 1.85, 1.93]
point = model.forecast(context, horizon=64)
# -> List[float], the point forecast
Moirai's Rust port is architecturally point-forecast only (no quantile/distribution decomposition is computed anywhere in this port, on the CLI or Python side) β forecast() here is already the full available output, not an abbreviation of a richer CLI result. The CLI (below) additionally supports batched and multivariate requests, still point-only.
Rust / CLI (cargo install zsfm)
cargo install zsfm --locked
# downloads the original weights and converts to GGUF locally
# (produces the same bytes as moirai-f32.gguf in this repo):
zsfm moirai convert --dtype f32 -o gguf/moirai-f32.gguf
echo '{"context": [0.85, 0.93, 1.01, 1.09, 1.17, 1.25, 1.33, 1.06, 1.14, 1.22, 1.3, 1.38, 1.46, 1.54, 1.27, 1.35, 1.43, 1.51, 1.59, 1.67, 1.75, 1.48, 1.56, 1.64, 1.72, 1.8, 1.88, 1.96, 1.69, 1.77, 1.85, 1.93], "horizon": 64}' \
| zsfm moirai infer --gguf gguf/moirai-f32.gguf
-m/--model takes the full HuggingFace repo id (default Salesforce/moirai-1.0-R-large) β there's only one published checkpoint for this architecture, so you normally don't need to change it. -o/--output defaults to gguf/moirai-f32.gguf regardless of --dtype, so always pass -o explicitly (as above) β otherwise repeated runs overwrite the same file under a name that may not even match the dtype you chose:
zsfm moirai convert --dtype f32 -o gguf/moirai-f32.gguf
zsfm moirai convert --dtype q8 -o gguf/moirai-q8.gguf
To skip conversion and run a file already published here:
huggingface-cli download amaye15/moirai-gguf moirai-f32.gguf --local-dir .
echo '{"context": [0.85, 0.93, 1.01, 1.09, 1.17, 1.25, 1.33, 1.06, 1.14, 1.22, 1.3, 1.38, 1.46, 1.54, 1.27, 1.35, 1.43, 1.51, 1.59, 1.67, 1.75, 1.48, 1.56, 1.64, 1.72, 1.8, 1.88, 1.96, 1.69, 1.77, 1.85, 1.93], "horizon": 64}' \
| zsfm moirai infer --gguf moirai-f32.gguf
Source, the other 9 time-series forecasters + 5 tabular models, and full docs: amaye15/zsfm-rs.
Response format
{
"id": "forecast-000001932b7a1234",
"object": "forecast",
"created": 1736290000,
"model": "moirai",
"choices": [{
"index": 0,
"forecast": {
"point": [2.1, 2.3, 2.5],
"quantiles": {}
},
"finish_reason": "stop"
}],
"usage": {"context_length": 32, "forecast_length": 64}
}
This architecture has no quantile output implemented in this port, so quantiles is always empty and point is the only forecast (an earlier version of this card incorrectly showed a populated quantiles example here β fixed).
Pass a batch of series ("context": [[...], [...]]) for one choice per series, or a 3D array ([batch][variate][time]) for multivariate input.
Architecture
Moirai-1.0-R-large is a universal forecasting foundation model:
- Input: Multi-patch-size projections β patches at sizes 8, 16, 32, 64, and 128 are embedded in parallel, giving the encoder a multi-scale view of the context
- Backbone: Bidirectional encoder (attends over the full context window); ~311M parameters
- Normalization: Mean-absolute-mean (absmean) instance normalization
- Output: Student-t distribution head producing probabilistic point forecasts
License
Conversion code: MIT (amaye15/zsfm-rs). Weights: CC-BY-NC-4.0 β NON-COMMERCIAL, per Salesforce's original release. These weights may not be used commercially. Conversion code in amaye15/zsfm-rs is MIT; only the weights carry the CC-BY-NC-4.0 restriction.
- Downloads last month
- 126
Model tree for amaye15/moirai-gguf
Base model
Salesforce/moirai-1.0-R-large