nanoforecast-500k

NanoForecast is the world's most deployable time series forecasting model (~1606K parameters). It trains on a laptop, runs on a Raspberry Pi, and exports to 1.4 MB ONNX for edge/IoT/browser deployment.

Built by Eulogik โ€” deployable AI for the real world.

Open in Spaces

GitHub

Model details

  • Profile: d64-L8
  • Parameters: 1,606,232
  • Context length: 256
  • Prediction length: 48
  • Patch size: 8
  • Hidden dim / layers: 64 / 8
  • Quantiles: [0.1, 0.25, 0.5, 0.75, 0.9]
  • Architecture: LongConv + DeltaNet RNN + Gated Router + MLP
  • Streaming inference: Stateful DeltaNet โ€” feed one value at a time
  • Deploy targets: CPU, ARM, Raspberry Pi, Lambda, iOS, browser (via ONNX.js)

Training

  • Datasets: ETTh1, ETTh2, ETTm1, exchange_rate, electricity, traffic
  • Synthetic records: 50,000
  • Epochs: 100
  • Learning rate: 5e-05
  • Batch size: 64
  • Best epoch: 85 (val_loss=0.2043)
  • Wall time: 15,176s (4.2h)
  • Hardware: Mac Mini M4 16GB (MPS)

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

Quickstart

import numpy as np
from nanoforecast import NanoForecast

model = NanoForecast.from_pretrained('eulogik/nanoforecast-500k')
context = np.sin(np.linspace(0, 8*np.pi, 256)) + 0.1 * np.random.randn(256)
out = model.predict(context, horizon=48, freq=1)
print(out['forecast'].shape)  # (48,) point forecast
print(out['quantiles'].shape)  # (5, 48)  p10..p90

Streaming inference (unique to NanoForecast)

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])

Deploy

# FastAPI server
pip install nanoforecast fastapi uvicorn python-multipart
python3 deploy/fastapi_server.py

# Docker
docker build -t nanoforecast -f deploy/Dockerfile .
docker run -p 8000:8000 nanoforecast

# ONNX export (1.4 MB)
pip install "nanoforecast[onnx]"
python3 -m nanoforecast.export.onnx_export --checkpoint <checkpoint-dir> --output nanoforecast.onnx

Try it in a browser

Upload your CSV to the Gradio Space and get a forecast in seconds.

Train on your own data

pip install nanoforecast
python3 train_from_csv.py --csv my_data.csv --target sales --horizon 48

Known limitations

This checkpoint was trained on 6 real datasets + 50K synthetic records for 100 epochs. It is not a production foundation model. Accuracy is modest (MASE ~3.45 overall). What it does well: being deployable. Train on your own data for better accuracy.

Attribution

Built by Eulogik โ€” deployable AI for the real world.

Downloads last month
29
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Space using eulogik/nanoforecast-500k 1