Timesfm GGUF
GGUF conversion of Google's TimesFM 2.5 — a 200M parameter decoder-only patch transformer. Converted and run with zsfm, a Rust workspace that ports zero-shot forecasting and tabular foundation models to GGUF +...
Model source
- Kind
- Other
- File size
- 234–882 MB
- Base model
- google/timesfm-2.5-200m-pytorch
- Version
- vRevision 8031a86
- Updated
- Oct 23, 2026
- Publisher
- @amaye15
- Downloads
- 84
- Parameters
- 200M
- Source
- Hugging Face
Source description
TimesFM 2.5 (Google) — GGUF
GGUF conversion of Google's TimesFM 2.5 — a 200M parameter decoder-only patch transformer. 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 |
|---|---|---|
timesfm-f32.gguf | timesfm-f16.gguf | timesfm-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: F16.
Context must be at least 32 timesteps (TimesFM patches the context in blocks of 32) — 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/timesfm-gguf", "timesfm-f16.gguf")
model = zsfm.TimesFmModel(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 (TimesFM's own dedicated point-forecast output, not a quantile)
# full 9-quantile distribution (added in zsfm 0.2.7)
quantile_matrix = model.forecast_quantiles(context, horizon=64) # 9 rows, one per level below
levels = model.quantiles() # [0.1, 0.2, ..., 0.9] — quantile_matrix[i] is the level[i] forecast
# note: quantile_matrix[4] (q0.5) is close to but NOT identical to `point` above —
# TimesFM decodes them as two separate output channels, not one derived from the other.
Rust / CLI (cargo install zsfm)
cargo install zsfm --locked
# downloads the original weights and converts to GGUF locally
# (produces the same bytes as timesfm-f16.gguf in this repo):
zsfm timesfm convert --dtype f16 -o gguf/timesfm-f16.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 timesfm infer --gguf gguf/timesfm-f16.gguf
-m/--model takes the full HuggingFace repo id (default google/timesfm-2.5-200m-pytorch) — there's only one published checkpoint for this architecture, so you normally don't need to change it. -o/--output defaults to gguf/timesfm.gguf (no dtype suffix — unlike every other model here) 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 timesfm convert --dtype f32 -o gguf/timesfm-f32.gguf
zsfm timesfm convert --dtype q8 -o gguf/timesfm-q8.gguf
To skip conversion and run a file already published here:
huggingface-cli download amaye15/timesfm-gguf timesfm-f16.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 timesfm infer --gguf timesfm-f16.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": "timesfm",
"choices": [{
"index": 0,
"forecast": {
"point": [2.1, 2.3, 2.5],
"quantiles": {
"0.10": [1.8, 2.0, 2.2],
"0.50": [2.1, 2.3, 2.5],
"0.90": [2.4, 2.6, 2.8]
}
},
"finish_reason": "stop"
}],
"usage": {"context_length": 32, "forecast_length": 64}
}
point is the median (q0.5); all 9 quantile levels (q0.10–q0.90) are included.
Pass a batch of series ("context": [[...], [...]]) for one choice per series.
Architecture
TimesFM 2.5 is a decoder-only patch transformer:
- Input: Context is split into 32-value patches; each patch is instance-normalized (RevIN with cumulative running statistics) and concatenated with an observation mask, producing 64-dim tokenizer inputs
- Backbone: 20-layer causal transformer, d_model=1280, 16 heads, head_dim=80, d_ff=1280; 200M parameters
- Attention: Sandwich norms (pre-norm → attention → post-norm + residual); fused QKV projection; per-dimension query scale
1.442695/√80 × softplus(param); QK RMSNorm after RoPE - AR decoding: KV cache with 4-patch decode stride — O(n) instead of O(n2) re-forward per step
- Output: Each output patch decoded through a ResidualBlock to
[n_patches, 128, 10]; index 0 is point forecast, indices 1–9 are quantiles q0.1–q0.9
License
Conversion code: MIT (amaye15/zsfm-rs). Weights: Apache-2.0, per Google's original release — unrestricted, including commercial use.
Sources
1 source
Sources
1 sourceVerified Oct 23
Download files
Model artifacts
3 artifacts
Model artifacts
3 artifactsSource excerpts
3 excerpts
Source excerpts
3 excerpts--- license: apache-2.0 library_name: gguf pipeline_tag: time-series-forecasting language: - en base_model: google/timesfm-2.5-200m-pytorch base_model_relation: quantized quantized_by: amaye15 tags: - gguf - time-series - forecasting - zero-shot - transformer - patch-based - rust inference: false --- # TimesFM 2.5 (Google) — GGUF GGUF conversion of [Google's TimesFM 2.5](https://huggingface.co/google/timesfm-2.5-200m-pytorch) — a 200M parameter decoder-only patch transformer. 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 | |---|---|---| | `timesfm-f32.gguf` | `timesfm-f16.gguf` | `timesfm-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: **F16**. **Context must be at least 32 timesteps** (TimesFM patches the context in blocks of 32) — 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/timesfm-gguf", "timesfm-f16.gguf") model = zsfm.TimesFmModel(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 (TimesFM's own dedicated point-forecast output, not a quantile) # full 9-quantile distribution (added in zsfm 0.2.7) quantile_matrix = model.forecast_quantiles(context, horizon=64) # 9 rows, one per level below levels = model.quantiles() # [0.1, 0.2, ..., 0.9] — quantile_matrix[i] is the level[i] forecast # note: quantile_matrix[4] (q0.5) is close to but NOT identical to `point` above — # TimesFM decodes them as two separate output channels, not one derived from the other. ``` ### Rust / CLI (`cargo install zsfm`) ```bash cargo install zsfm --locked ``` ```bash # downloads the original weights and converts to GGUF locally # (produces the...
--- license: mit library_name: gguf pipeline_tag: time-series-forecasting language: - en base_model: google/timesfm-2.5-200m-pytorch base_model_relation: quantized quantized_by: amaye15 tags: - gguf - time-series - forecasting - zero-shot - probabilistic - transformer - patch-based - rust inference: false --- # timesfm-rs Pure Rust converter and inference engine for [google/timesfm-2.5-200m-pytorch](https://huggingface.co/google/timesfm-2.5-200m-pytorch). Pre-converted GGUF files are available at [amaye15/timesfm-gguf](https://huggingface.co/amaye15/timesfm-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/timesfm-rs convert --model google/timesfm-2.5-200m-pytorch --dtype f16 --output gguf/timesfm-f16.gguf # Q8_0 (smallest) ./target/release/timesfm-rs convert --dtype q8 --output gguf/timesfm-q8.gguf # F32 (full precision) ./target/release/timesfm-rs convert --dtype f32 --output gguf/timesfm-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 GGUF file: ```bash ./target/release/timesfm-rs inspect-tensors gguf/timesfm-f16.gguf ``` ## Infer Run forecasting from comma-separated context values: ```bash echo '{"context": [1.0, 1.2, 1.5, 1.3, 1.8, 2.0, 1.9, 2.1], "horizon": 64}' \ | ./target/release/timesfm-rs infer --gguf gguf/timesfm-f16.gguf ``` Output is JSON in an OpenAI-compatible forecast format with point forecast and all 9 quantile channels (q0.1–q0.9): ```json { "id": "forecast-000001932b7a1234", "object": "forecast", "created": 1749686400, "model": "timesfm", "choices": [{ "index": 0, "forecast": { "point": [2.1, 2.3, 2.5, "..."], "quantiles": { "0.10": [1.8, 2.0, 2.2, "..."], "0.50": [2.1, 2.3, 2.5, "..."], "0.90": [2.4, 2.6, 2.8, "..."] } }, "finish_reason": "stop" }], "usage": {"context_length": 8, "forecast_length": 64} } ``` **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": 64}' \ | ./target/release/timesfm-r...
Source context: 1088 downloads · 0 likes · Pipeline time-series-forecasting · Library gguf · Repo amaye15/timesfm-gguf
