Ttm GGUF
GGUF conversion of IBM Granite's TTM-R2 (TinyTimeMixer) — a 1M parameter compact time-series foundation model. Converted and run with zsfm, a Rust workspace that ports zero-shot forecasting and tabular foundation...
Modellquelle
- Art
- Forecasting model
- Dateigröße
- 896 KB–3,08 MB
- Basismodell
- ibm-granite/granite-timeseries-ttm-r2
- Version
- vRevision 3decb28
- Aktualisiert
- 3. Okt. 2026
- Verleger
- @amaye15
- Downloads
- 230
- Quelle
- Hugging Face
Quellenbeschreibung
TTM-R2 (IBM Granite TinyTimeMixer) — GGUF
GGUF conversion of IBM Granite's TTM-R2 (TinyTimeMixer) — a ~1M parameter compact time-series 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 |
|---|---|---|
ttm-f32.gguf | ttm-f16.gguf | ttm-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.
There's no config.json in this repo — GGUF embeds its own architecture metadata for the CLI, but the Python bindings still need config.json from ibm-granite/granite-timeseries-ttm-r2.
Context must be at least 64 timesteps (TTM's patch_length is 64; shorter contexts are rejected outright rather than padded) — a shorter context fails with context too short. The examples below use a 64-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/ttm-gguf", "ttm-f32.gguf")
config_path = hf_hub_download("ibm-granite/granite-timeseries-ttm-r2", "config.json")
model = zsfm.TtmModel(gguf_path, config_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, 2.01, 2.09, 2.17, 1.9, 1.98, 2.06, 2.14, 2.22, 2.3, 2.38, 2.11, 2.19, 2.27, 2.35, 2.43, 2.51, 2.59, 2.32, 2.4, 2.48, 2.56, 2.64, 2.72, 2.8, 2.53, 2.61, 2.69, 2.77, 2.85, 2.93, 3.01, 2.74]
point = model.forecast(context, horizon=64)
# -> List[float], a plain point forecast (median only; TTM's decoder has no quantile head, so there's nothing else to return)
config has no working default — pass it explicitly (an omitted config falls back to a hardcoded path that almost never exists on your machine, raising FileNotFoundError).
Rust / CLI (cargo install zsfm)
cargo install zsfm --locked
# downloads the original weights and converts to GGUF locally
# (produces the same bytes as ttm-f32.gguf in this repo) — `convert` also caches config.json exactly where `infer --config` defaults to, so it's omitted below:
zsfm ttm convert --dtype f32 -o gguf/ttm-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, 2.01, 2.09, 2.17, 1.9, 1.98, 2.06, 2.14, 2.22, 2.3, 2.38, 2.11, 2.19, 2.27, 2.35, 2.43, 2.51, 2.59, 2.32, 2.4, 2.48, 2.56, 2.64, 2.72, 2.8, 2.53, 2.61, 2.69, 2.77, 2.85, 2.93, 3.01, 2.74], "horizon": 64}' \
| zsfm ttm infer --gguf gguf/ttm-f32.gguf
-m/--model takes the full HuggingFace repo id (default ibm-granite/granite-timeseries-ttm-r2) — there's only one published checkpoint for this architecture, so you normally don't need to change it. -o/--output defaults to gguf/ttm-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 ttm convert --dtype f32 -o gguf/ttm-f32.gguf
zsfm ttm convert --dtype q8 -o gguf/ttm-q8.gguf
To skip conversion and run a file already published here:
huggingface-cli download amaye15/ttm-gguf ttm-f32.gguf --local-dir .
huggingface-cli download ibm-granite/granite-timeseries-ttm-r2 config.json --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, 2.01, 2.09, 2.17, 1.9, 1.98, 2.06, 2.14, 2.22, 2.3, 2.38, 2.11, 2.19, 2.27, 2.35, 2.43, 2.51, 2.59, 2.32, 2.4, 2.48, 2.56, 2.64, 2.72, 2.8, 2.53, 2.61, 2.69, 2.77, 2.85, 2.93, 3.01, 2.74], "horizon": 64}' \
| zsfm ttm infer --gguf ttm-f32.gguf --config config.json
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": "ttm",
"choices": [{
"index": 0,
"forecast": {
"point": [2.1, 2.3, 2.5],
"quantiles": {}
},
"finish_reason": "stop"
}],
"usage": {"context_length": 64, "forecast_length": 64}
}
This architecture has no quantile head, so quantiles is always empty and point is the only forecast.
Pass a batch of series ("context": [[...], [...]]) for one choice per series.
Architecture
TTM (Tiny Time-Mixer) is a compact encoder-decoder model:
- Encoder: Multi-layer mixer blocks operating across the patch dimension; adaptive patching levels allow different temporal resolutions simultaneously
- Decoder: Lightweight projection from encoder representations to the forecast horizon
- Scale: ~1M parameters — orders of magnitude smaller than transformer-based foundation models, competitive on short-horizon benchmarks
- Config:
context_length,prediction_length,patch_length,patch_stride,d_model,num_layers,decoder_num_layers, andadaptive_patching_levelsare loaded fromconfig.json
License
Conversion code: MIT (amaye15/zsfm-rs). Weights: Apache-2.0, per IBM Granite's original release — unrestricted, including commercial use.
Quellen
1 Quelle
Quellen
1 QuelleVerifiziert 3. Okt.
Modellartefakte
3 Artefakte
Modellartefakte
3 ArtefakteQuellenauszüge
3 Auszüge
Quellenauszüge
3 Auszüge--- license: apache-2.0 library_name: gguf pipeline_tag: time-series-forecasting language: - en base_model: ibm-granite/granite-timeseries-ttm-r2 base_model_relation: quantized quantized_by: amaye15 tags: - gguf - time-series - forecasting - zero-shot - mlp-mixer - rust inference: false --- # TTM-R2 (IBM Granite TinyTimeMixer) — GGUF GGUF conversion of [IBM Granite's TTM-R2](https://huggingface.co/ibm-granite/granite-timeseries-ttm-r2) (TinyTimeMixer) — a ~1M parameter compact time-series foundation 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 | |---|---|---| | `ttm-f32.gguf` | `ttm-f16.gguf` | `ttm-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**. There's no `config.json` in this repo — GGUF embeds its own architecture metadata for the CLI, but the Python bindings still need `config.json` from [ibm-granite/granite-timeseries-ttm-r2](https://huggingface.co/ibm-granite/granite-timeseries-ttm-r2). **Context must be at least 64 timesteps** (TTM's patch_length is 64; shorter contexts are rejected outright rather than padded) — a shorter context fails with `context too short`. The examples below use a 64-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/ttm-gguf", "ttm-f32.gguf") config_path = hf_hub_download("ibm-granite/granite-timeseries-ttm-r2", "config.json") model = zsfm.TtmModel(gguf_path, config_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, 2.01, 2.09, 2.17, 1.9, 1.98, 2.06, 2.14, 2.22, 2.3, 2.38, 2.11, 2.19, 2.27, 2.35, 2.43, 2.51, 2.59, 2.32, 2.4, 2.48, 2.56, 2.64, 2.72, 2.8, 2.53, 2.61, 2.69, 2.77, 2.85, 2.93, 3.01, 2.74] point = model.forecast(context, horizon=64) # -> List[float], a plain point forecast (median only; TTM's decoder has no quantile head, so there'...
--- license: mit library_name: gguf pipeline_tag: time-series-forecasting language: - en base_model: ibm-granite/granite-timeseries-ttm-r2 base_model_relation: quantized quantized_by: amaye15 tags: - gguf - time-series - forecasting - zero-shot - mlp-mixer - rust inference: false --- # ttm-rs Pure Rust converter and inference engine for [ibm-granite/granite-timeseries-ttm-r2](https://huggingface.co/ibm-granite/granite-timeseries-ttm-r2). Pre-converted GGUF files are available at [amaye15/ttm-gguf](https://huggingface.co/amaye15/ttm-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/ttm-rs convert --model ibm-granite/granite-timeseries-ttm-r2 --dtype f16 --output gguf/ttm-f16.gguf # Q8_0 (smallest) ./target/release/ttm-rs convert --dtype q8 --output gguf/ttm-q8.gguf # F32 (full precision) ./target/release/ttm-rs convert --dtype f32 --output gguf/ttm-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 file: ```bash ./target/release/ttm-rs inspect-tensors models/model.safetensors ``` ## Infer Run forecasting from comma-separated context values. The context must be at least `patch_length` steps (defined in `config.json`): ```bash echo '{"context": [1.0, 1.2, 1.5, 1.3, 1.8, 2.0, 1.9, 2.1], "horizon": 96}' \ | ./target/release/ttm-rs infer \ --gguf gguf/ttm-f16.gguf \ --config models/config.json ``` Output is JSON in an OpenAI-compatible forecast format: ```json { "id": "forecast-000001932b7a1234", "object": "forecast", "created": 1749686400, "model": "ttm", "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/ttm-rs infer \ --gguf gguf/ttm-f16.gguf \ --config models/config.json ``` ## Python bindings Install with...
Source context: 230 downloads · 0 likes · Pipeline time-series-forecasting · Library gguf · Repo amaye15/ttm-gguf
