--- license: apache-2.0 library_name: pytorch pipeline_tag: time-series-forecasting tags: - time-series - forecasting - pytorch - deployable - edge-ai - onnx - streaming - raspberry-pi - transformer - zero-shot - iot - real-time - tiny-ml - timesfm-alternative - huggingface metrics: - mase - smape - mae - crps model-index: - name: NanoForecast 500k results: - task: type: time-series-forecasting name: Time Series Forecasting dataset: name: ETTh1 type: ett config: h1 metrics: - type: mase value: 3.342 name: MASE - type: smape value: 25.13 name: sMAPE (%) - task: type: time-series-forecasting name: Time Series Forecasting dataset: name: ETTh2 type: ett config: h2 metrics: - type: mase value: 3.707 name: MASE - type: smape value: 17.65 name: sMAPE (%) - task: type: time-series-forecasting name: Time Series Forecasting dataset: name: ETTm1 type: ett config: m1 metrics: - type: mase value: 3.578 name: MASE - type: smape value: 17.22 name: sMAPE (%) - task: type: time-series-forecasting name: Time Series Forecasting dataset: name: Overall type: multi-dataset metrics: - type: mase value: 3.453 name: Overall MASE - type: smape value: 18.68 name: Overall sMAPE (%) ---

๐Ÿ”ฎ NanoForecast 500k (v0.2)
Ultra-lightweight time series transformer

1.6M params ยท 256 context ยท Streaming RNN ยท ONNX-ready
Runs on CPU, Raspberry Pi, and in the browser

๐Ÿš€ New: Try the improved nanoforecast-v03 โ€” 21% better MASE, 6.5M params, 512 context!

--- ## ๐Ÿ“ฆ Quick Start ```bash pip install nanoforecast ``` ```python from nanoforecast import NanoForecast model = NanoForecast.from_pretrained("eulogik/nanoforecast-500k") ``` ## ๐Ÿ† Benchmarks | Dataset | MASE | sMAPE (%) | MAE | CRPS | |---|---:|---:|---:|---:| | ETTh1 | 3.342 | 25.13 | 2.402 | 1.800 | | ETTh2 | 3.707 | 17.65 | 3.212 | 2.518 | | ETTm1 | 3.578 | 17.22 | 1.174 | 1.003 | | exchange_rate | 7.306 | 1.63 | 0.010 | 0.009 | | electricity | 1.536 | 5.65 | 189.748 | 187.256 | | traffic | 1.246 | 44.80 | 0.006 | 0.005 | | **Overall** | **3.453** | **18.68** | **32.759** | **32.099** | > ๐Ÿ”ฅ For better accuracy, upgrade to [nanoforecast-v03](https://huggingface.co/eulogik/nanoforecast-v03) (MASE 2.73, **21% improvement**). ## ๐Ÿ”„ Streaming Inference (Unique to NanoForecast) ```python result = model.predict(context, horizon=48, return_state=True) state = result.pop("state") for new_val in incoming_data_stream: result = model.predict_step(new_val, state, horizon=48) print(result["forecast"][0, :5]) ``` Perfect for IoT, real-time dashboards, and live financial data. ## ๐Ÿ“‹ Model Details | Attribute | Value | |---|---| | Profile | `d64-L8` | | Parameters | 1,606,232 | | Context | 256 | | Horizon | 48 | | Size | 6.4 MB (FP32), ~1.4 MB (ONNX) | | Architecture | LongConv + DeltaNet RNN + Gated Router + MLP | | Deploy targets | CPU, ARM, Raspberry Pi, Lambda, iOS, browser | ## ๐ŸŽฏ Try It in 1 Click [![Open in HF Spaces](https://img.shields.io/badge/๐Ÿค—%20Open%20in%20Spaces-blueviolet)](https://huggingface.co/spaces/eulogik/nanoforecast) Upload a CSV โ†’ forecast + prediction intervals. No code. No GPU. ## ๐Ÿ“š All Variants | Model | Params | Context | MASE | Best For | |---|---|---|---|---| | [nanoforecast-200k](https://huggingface.co/eulogik/nanoforecast-200k) | 676K | 256 | ~4-11 | Extreme edge / RPi Zero | | **nanoforecast-500k** (you are here) | **1.6M** | **256** | **3.45** | General purpose | | [nanoforecast-v03](https://huggingface.co/eulogik/nanoforecast-v03) | **6.5M** | **512** | **2.73** | Max accuracy | ## โšก Deploy ```bash # FastAPI pip install nanoforecast fastapi uvicorn python-multipart python3 deploy/fastapi_server.py # ONNX pip install "nanoforecast[onnx]" python3 -m nanoforecast.export.onnx_export --checkpoint --output nanoforecast.onnx ``` ## โค๏ธ Built by Eulogik [![Eulogik](https://img.shields.io/badge/by-Eulogik-purple)](https://eulogik.com) **Eulogik** โ€” deployable AI for the real world. Star the repo โญ on [GitHub](https://github.com/eulogik/NanoForecast)!