OpenSTEF 4.0 is now available, and it ships with a redesigned modular architecture, a metalearning ensemble system, a foundation model forecaster, and a new backtesting and evaluation framework called BEAM. Alliander runs OpenSTEF in production at thousands of grid locations today, and Sigholm uses it to optimize approximately 40 percent of Sweden’s district heating production. The 4.0 release makes that same forecasting capability easier to adopt, extend, and apply to new use cases. Install it now with pip install openstef.
What Is OpenSTEF?
OpenSTEF (Open Short Term Energy Forecasting) is an open source Python package that provides a comprehensive portfolio of machine learning pipelines to create accurate short-term energy forecasts. It is collaboratively developed by a growing community of grid operators, technology vendors, researchers, and energy-sector experts, and is hosted at LF Energy. It generates probabilistic forecasts for hours to days ahead for any given energy signal, enabling grid operators, energy companies, and researchers to anticipate congestion, support grid safety analysis, and optimize flexible assets.
What’s New in OpenSTEF 4.0
OpenSTEF 4.0 is a ground up redesign of the codebase into a set of modular packages, each with a focused responsibility:
- openstef-core: shared dataset types, utilities, and the contracts that every other package builds on.
- openstef-models: the forecasting models and feature engineering pipeline, including the individual forecasters (LightGBM, XGBoost, GBLinear) and component splitting.
- openstef-meta: metalearning and ensemble model selection, combining multiple forecasters into a single, more capable prediction.
- openstef-beam: backtesting, evaluation, analysis, metrics for systematic model comparison, and performance measurement without having to wait for operational results.
- openstef-foundation-models: pretrained foundation model forecasters that work without per-target training.
Splitting the pipeline this way means a team can adopt the pieces relevant to their use case, extend or replace individual components, and integrate OpenSTEF into any existing IT environment. OpenSTEF 4.0 focuses more than ever on data science, leaving the data engineering and MLops integration entirely to the user, which can be specific to the IT environments the user has at their disposal. It is also what unlocks three genuinely new capabilities in this release.
Metalearning: combining models instead of choosing one
Tree based models like LightGBM and XGBoost capture complex, non-linear interactions between weather, time of day, and load, but they cannot extrapolate beyond the range of values they were trained on. Linear models can extrapolate but miss non-linear patterns. That tradeoff matters most during congestion events and seasonal transitions, exactly when accurate forecasts matter most.
openstef-meta introduces EnsembleForecastingModel, which runs multiple forecasters in parallel and learns, quantile by quantile, when to trust each one. Two combiner strategies are available: a WeightsCombiner that produces an interpretable weighted average, and a StackingCombiner that trains a meta-regressor on top of the base predictions for cases where the models contain complementary signals.
openstef-meta also allows you to build your own meta-forecasters similar to putting together Lego blocks of different baselearners, each with their own pre-processing and feature engineering if necessary, unlocking infinite meta-learning possibilities.
Foundation model forecasting: highly performant
openstef-foundation-models adds a pretrained foundation model forecaster that forecasts a meter it has never seen before, with no training required. This gives OpenSTEF users three practical advantages: no per-target training or storage overhead across thousands of targets, forecasts for new or short-history meters, and high forecasting performance. OpenSTEF provides methods for all popular machine learning approaches to forecasting, including classic machine learning, ensemble learning, and foundation models. OpenSTEF embraces foundational models as a major advancement in forecasting and recognizes their ability to deliver strong performance across a wide range of use cases. At the same time, OpenSTEF acknowledges that no single forecasting approach is universally superior. Specialized and classical models can still outperform foundational models when addressing domain-specific problems or data patterns that are underrepresented in the foundational model’s training data.
Foundation model forecasts plug into the same probabilistic quantile output as every other OpenSTEF model, and OpenSTEF automatically detects available hardware to make use of a GPU or Apple Silicon where present. The modular setup enables users to set their own forecasting strategy, and generic pipelines enable operation in any production setup.
BEAM: systematic, reproducible model evaluation
OpenSTEF’s philosophy is therefore model agnostic: we support the full spectrum of forecasting approaches and enable users to identify the method that performs best for their specific use case. Comparing forecasting models at scale though is easy to get wrong: inconsistent evaluation windows, mismatched data splits, or accidental future data leakage can all invalidate a comparison. openstef-beam was built to make this evaluation process systematic, transparent, and repeatable. It addresses model comparison challenges with a three stage pipeline, backtesting, evaluation, and analysis, that is fully decoupled so each stage can be rerun independently. It segments results by lead time, by when the prediction was generated, and across rolling time windows, and it uses a RestrictedHorizonVersionedTimeSeries to guarantee that a model never sees data during backtesting that would not have been available to it in production.
Benefits for Users
The modular architecture and new packages translate into concrete gains for the people building on OpenSTEF:
- Faster implementation. A smaller, more focused, IT-agnostic pipeline reduces the effort needed to get from experimentation to production, and fits more readily into any existing IT environment.
- Adaptable to your workflow. Because the packages are modular, teams can adopt only the components they need and adapt the setup to their preferred forecasting workflow.
- Broader application of energy forecasting. The same pipeline that is powering distribution congestion management for Alliander and heat demand forecasting for Sigholm is now easier to apply to other forecasting driven use cases, including trading and flexibility optimization.
- Stronger forecasting performance. The metalearning ensemble and foundation model forecaster give users more accurate predictions and a faster path to a working baseline.
- More rigorous evaluation. BEAM gives teams a repeatable way to answer “is this new model actually better?” instead of relying on ad hoc comparisons. It also ensures users pick the right type of ML for their use case: more compute and memory intensive foundational models, or light-weight classic ML.
- Better documentation. The 4.0 documentation set includes new user guides, quickstarts, and worked examples, alongside a dedicated migration guide for teams moving from OpenSTEF 3.
Getting Started
OpenSTEF 4.0 is available now:
pip install openstef
It is also available via uv and pypi. See the installation guide for details, or jump straight into the forecasting quickstart and the foundation model forecasting quickstart. Teams already running OpenSTEF 3 should start with the migration guide; the previous version remains available by pinning openstef>=3.0,<4.
Full technical documentation, including the API reference and concept guides for BEAM, metalearning, component splitting, and foundation models, is available at openstef.github.io/openstef.
Get Involved
OpenSTEF is built by and for its community of grid operators, data scientists, and researchers. If you want to help shape where the project goes next:
- Visit the all-new OpenSTEF website at https://openstef.energy
- Explore the source code and release notes on GitHub.
- Read the contributing guide to learn how to submit code, report issues, or join a community meeting.
- Open a discussion or issue to share how you are using OpenSTEF or ask the maintainers a question.
Frequently Asked Questions
What is the current release status of OpenSTEF 4.0? OpenSTEF 4.0.0 has been merged into the main branch with full documentation and is ready for general use. The previous major version, V3, remains available on the release/v3 branch and can still be installed by pinning openstef>=3.0,<4.
What community activity supports this project? OpenSTEF is hosted at LF Energy and developed with contributions from a growing community of grid operators, technology vendors, researchers, and energy-sector experts. The project maintains public documentation, a contributing guide, and community meetings for anyone who wants to get involved.
What does a typical implementation look like? Most teams start with openstef-core and openstef-models to produce a forecast, then add openstef-beam to evaluate model quality and openstef-meta or openstef-foundation-models as needed. Because the packages are modular, you can adopt only the pieces relevant to your use case.
Where can I access the documentation and source code? The full documentation is at openstef.github.io/openstef, and the source code, release notes, and issue tracker are on GitHub.
About OpenSTEF
OpenSTEF (Open Short Term Energy Forecasting) is an open source Python package that provides a comprehensive portfolio of machine learning pipelines to create accurate short-term energy forecasts. It is collaboratively developed by a growing community of grid operators, technology vendors, researchers, and energy-sector experts, and is hosted at LF Energy. It generates probabilistic forecasts for hours to days ahead for any given energy signal, enabling grid operators, energy companies, and researchers to anticipate congestion, support grid safety analysis, and optimize flexible assets.
About LF Energy
LF Energy is the Linux Foundation’s neutral home to build the digital foundation for energy together. We host more than three dozen open source projects used to plan, operate, and modernize energy systems. The portfolio spans from transmission system modeling to substation virtualization, smart meter integration to EV charging. We provide the trust layer: neutral governance, legal frameworks, security practices, and community of practitioners that turn open source software, standards, and data into infrastructure the industry can depend on for decades. Members include utilities, energy companies, vendors, researchers, and technology providers, aligned to deliver affordable, reliable, safe, and clean energy. For more information, please visit lfenergy.org.