Views
No views yet
cargo build --release1# F16 (recommended)
2./target/release/moirai-2-rs convert --model Salesforce/moirai-2.0-R-small --dtype f16 --output gguf/moirai2-f16.gguf
3
4# Q8_0 (smallest)
5./target/release/moirai-2-rs convert --dtype q8 --output gguf/moirai2-q8.gguf
6
7# F32 (full precision)
8./target/release/moirai-2-rs convert --dtype f32 --output gguf/moirai2-f32.gguf./scripts/convert_all.shHF_TOKEN=hf_... ./scripts/convert_all.sh.safetensors checkpoint:./target/release/moirai-2-rs inspect-tensors models/model.safetensors1echo '{"context": [1.0, 1.2, 1.5, 1.3, 1.8, 2.0, 1.9, 2.1], "horizon": 96}' \
2 | ./target/release/moirai-2-rs infer --gguf gguf/moirai2-f16.gguf1{
2 "id": "forecast-000001932b7a1234",
3 "object": "forecast",
4 "created": 1749686400,
5 "model": "moirai-2",
6 "choices": [{
7 "index": 0,
8 "forecast": {
9 "point": [2.1, 2.3, 2.5, "..."],
10 "quantiles": {}
11 },
12 "finish_reason": "stop"
13 }],
14 "usage": {"context_length": 8, "forecast_length": 96}
15}Choice per series:1echo '{"context": [[1.0, 1.2, 1.5], [2.0, 2.2, 2.5]], "horizon": 96}' \
2 | ./target/release/moirai-2-rs infer --gguf gguf/moirai2-f16.gguf[batch][variate][time] to get a variates array in each choice. Each variate is processed independently (channel-independent):1echo '{
2 "context": [
3 [[1.0, 1.2, 1.5, 1.3, 1.8, 2.0, 1.9, 2.1],
4 [0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2]]
5 ],
6 "horizon": 96
7}' \
8 | ./target/release/moirai-2-rs infer --gguf gguf/moirai2-f16.gguf1{
2 "choices": [{
3 "index": 0,
4 "forecast": {
5 "variates": [
6 {"point": [2.1, 2.3, "..."], "quantiles": {}},
7 {"point": [1.3, 1.4, "..."], "quantiles": {}}
8 ]
9 },
10 "finish_reason": "stop"
11 }]
12}1python -m venv .venv && source .venv/bin/activate
2pip install maturin
3maturin develop --features python1import moirai_2_rs
2
3model = moirai_2_rs.Moirai2("gguf/moirai2-f16.gguf")
4
5result = model.forecast([1.0, 1.2, 1.5, 1.3, 1.8, 2.0], horizon=96)
6point = result["choices"][0]["forecast"]["point"]
7
8# Batch — one Choice per series
9result = model.forecast([[1.0, 1.2, 1.5], [2.0, 2.2, 2.5]], horizon=96)forecast returns a Python dict in the same OpenAI-compatible format as the CLI.