Foundation forecasts that come with error bars
Lag-Llama is a pre-trained probabilistic forecaster meant to work zero-shot on any frequency time series, then improve when finetuned.

What it does Lag-Llama is a pre-trained transformer that outputs a probability distribution for each future time step rather than a single point estimate. The authors bill it as the first open-source foundation model for time series forecasting: you can feed it a series of any frequency and ask for any prediction length in zero-shot mode, or finetune it on your own data. They provide model weights, Colab demos, and shell scripts to reproduce the paper’s pretraining and finetuning pipeline.
The interesting bit Instead of predicting “the value will be 42,” it predicts a full distribution so you can reason about uncertainty. The catch is that zero-shot performance is tightly coupled to context length—the model was trained on 32-step windows, and the authors recommend enabling RoPE scaling and sweeping lengths up to 1024 to find what works for your data. That makes it more of a capable primitive than a drop-in oracle.
Key highlights
- Probabilistic by design: every forecast is a distribution, not a scalar.
- Zero-shot inference on arbitrary frequencies and prediction lengths via HuggingFace weights.
- Pretraining and finetuning scripts released to replicate the paper’s experiments.
- Best-practices documentation is refreshingly honest: finetuning beats zero-shot, and more data helps.
Caveats
- A June 2024 patch fixed critical bugs in the
kv_cacheimplementation that had been silently hurting forecast accuracy; earlier commits or forks may give misleading results. - The README is light on quantitative results, so you’ll need to read the paper or run the reproduction scripts to see how it actually compares.
- Getting good performance requires grid-searching context length and learning rate, plus a validation split with early stopping patience of 50 epochs.
Verdict Try it if you need probabilistic forecasts and want to test whether a pre-trained model can outperform training from scratch on your data. Give it a pass if you need deterministic point predictions or a solution that works out of the box without tuning context windows and learning rates.
Frequently asked
- What is time-series-foundation-models/lag-llama?
- Lag-Llama is a pre-trained probabilistic forecaster meant to work zero-shot on any frequency time series, then improve when finetuned.
- Is lag-llama open source?
- Yes — time-series-foundation-models/lag-llama is open source, released under the Apache-2.0 license.
- What language is lag-llama written in?
- time-series-foundation-models/lag-llama is primarily written in Python.
- How popular is lag-llama?
- time-series-foundation-models/lag-llama has 1.6k stars on GitHub.
- Where can I find lag-llama?
- time-series-foundation-models/lag-llama is on GitHub at https://github.com/time-series-foundation-models/lag-llama.