Moirai 2 GGUF
> ⚠️ Non-commercial license. These weights are CC-BY-NC-4.0 — see License below before using them in any commercial product or service.
Model source
- Kind
- Other
- File size
- 11.5–43.4 MB
- Base model
- Salesforce/moirai-2.0-R-small
- Version
- vRevision dca7eac
- Updated
- Oct 22, 2026
- Publisher
- @amaye15
- Downloads
- 87
- Source
- Hugging Face
Source description
Moirai-2.0-R-small (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-2.0-R-small — a compact causal-decoder universal forecasting 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 |
|---|---|---|
moirai2-f32.gguf | moirai2-f16.gguf | moirai2-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-2 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-2-gguf", "moirai2-f32.gguf")
model = zsfm.Moirai2Model(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-2'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 moirai2-f32.gguf in this repo):
zsfm moirai2 convert --dtype f32 -o gguf/moirai2-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 moirai2 infer --gguf gguf/moirai2-f32.gguf
-m/--model takes the full HuggingFace repo id (default Salesforce/moirai-2.0-R-small) — there's only one published checkpoint for this architecture, so you normally don't need to change it. -o/--output defaults to gguf/moirai2-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 moirai2 convert --dtype f32 -o gguf/moirai2-f32.gguf
zsfm moirai2 convert --dtype q8 -o gguf/moirai2-q8.gguf
To skip conversion and run a file already published here:
huggingface-cli download amaye15/moirai-2-gguf moirai2-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 moirai2 infer --gguf moirai2-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": "moirai2",
"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-2.0-R-small is a compact causal decoder:
- Backbone: Causal (decoder-only) transformer — unlike Moirai-1 which uses a bidirectional encoder; d_model=384, 6 layers, 6 heads
- Attention: Binary attention bias encoding variate identity (BinaryAttentionBias); partial interleaved RoPE applied to the first 32 of 64 head dimensions
- Decode loop: Predicts 4 patches (64 steps) per forward pass; runs multiple passes for longer horizons
- Normalization: PackedStdScaler with Bessel correction (ddof=1), min_scale=1e-5
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.
Sources
1 source
Sources
1 sourceVerified Oct 22
Download files
Model artifacts
3 artifacts
Model artifacts
3 artifactsSource excerpts
3 excerpts
Source excerpts
3 excerpts--- license: cc-by-nc-4.0 library_name: gguf pipeline_tag: time-series-forecasting language: - en base_model: Salesforce/moirai-2.0-R-small base_model_relation: quantized quantized_by: amaye15 tags: - gguf - time-series - forecasting - zero-shot - universal-forecasting - rust inference: false --- # Moirai-2.0-R-small (Salesforce) — GGUF > **⚠️ Non-commercial license.** These weights are CC-BY-NC-4.0 — see [License](#license) below before using them in any commercial product or service. GGUF conversion of [Salesforce's Moirai-2.0-R-small](https://huggingface.co/Salesforce/moirai-2.0-R-small) — a compact causal-decoder universal forecasting model. Converted and run with [**zsfm**](https://github.com/amaye15/zsfm-rs), a Rust workspace that ports zero-shot forecasting and tabular foundation models to GGUF + [candle](https://github.com/huggingface/candle). No PyTorch, no Python runtime required to run inference. | F32 | F16 | Q8_0 | |---|---|---| | `moirai2-f32.gguf` | `moirai2-f16.gguf` | `moirai2-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-2 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`) ```bash pip install zsfm huggingface_hub ``` ```python import zsfm from huggingface_hub import hf_hub_download gguf_path = hf_hub_download("amaye15/moirai-2-gguf", "moirai2-f32.gguf") model = zsfm.Moirai2Model(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-2'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`) ```bash c...
--- license: mit library_name: gguf pipeline_tag: time-series-forecasting language: - en base_model: Salesforce/moirai-2.0-R-small base_model_relation: quantized quantized_by: amaye15 tags: - gguf - time-series - forecasting - zero-shot - transformer - universal-forecasting - rust inference: false --- # moirai-2-rs Pure Rust converter and inference engine for [Salesforce/moirai-2.0-R-small](https://huggingface.co/Salesforce/moirai-2.0-R-small). Pre-converted GGUF files are available at [amaye15/moirai-2-gguf](https://huggingface.co/amaye15/moirai-2-gguf). Produces GGUF v3 files and runs native forecasting — no Python required. ## Build ```bash cargo build --release ``` ## Convert Downloads the model from HuggingFace and writes a GGUF file: ```bash # F16 (recommended) ./target/release/moirai-2-rs convert --model Salesforce/moirai-2.0-R-small --dtype f16 --output gguf/moirai2-f16.gguf # Q8_0 (smallest) ./target/release/moirai-2-rs convert --dtype q8 --output gguf/moirai2-q8.gguf # F32 (full precision) ./target/release/moirai-2-rs convert --dtype f32 --output gguf/moirai2-f32.gguf ``` To convert all dtypes at once: ```bash ./scripts/convert_all.sh ``` HuggingFace token (optional for public models): ```bash HF_TOKEN=hf_... ./scripts/convert_all.sh ``` ## Inspect tensors Print all tensor names and shapes from a `.safetensors` checkpoint: ```bash ./target/release/moirai-2-rs inspect-tensors models/model.safetensors ``` ## Infer Run forecasting from stdin JSON: ```bash echo '{"context": [1.0, 1.2, 1.5, 1.3, 1.8, 2.0, 1.9, 2.1], "horizon": 96}' \ | ./target/release/moirai-2-rs infer --gguf gguf/moirai2-f16.gguf ``` Output is JSON in an OpenAI-compatible forecast format: ```json { "id": "forecast-000001932b7a1234", "object": "forecast", "created": 1749686400, "model": "moirai-2", "choices": [{ "index": 0, "forecast": { "point": [2.1, 2.3, 2.5, "..."], "quantiles": {} }, "finish_reason": "stop" }], "usage": {"context_length": 8, "forecast_length": 96} } ``` **Batch inference** — pass multiple series as a nested array to get one `Choice` per series: ```bash echo '{"context": [[1.0, 1.2, 1.5], [2.0, 2.2, 2.5]], "horizon": 96}' \ | ./target/release/moirai-2-rs infer --gguf gguf/moirai2-f16.gguf ``` **Multivariate inference** — pass a 3D context array `[batch][variate][time]` to get a `variates` array in each choice. Each...
Source context: 184 downloads · 0 likes · Pipeline time-series-forecasting · Library gguf · Repo amaye15/moirai-2-gguf
