ECMWF's AI forecasting model is open source: now let's make it easy to run.

Community Article
Published July 28, 2026

📄 Paper | 🌍 Anemoi | 🌤 AIFS Single 2.0 | 🖥 Code & tutorials

Authors: Emma Scharfmann (Hugging Face), Harrison Cook (ECMWF)

Making models open source is great, but if there's a lot of friction to actually running them, it doesn't make them very accessible to the community. So this post explores how we can close that gap: not just making models open source, but also easier to run. ECMWF had the same goal when they open-sourced their new AI models, AIFS, and this blog is the result of our work together to make that happen.

AIFS is ECMWF's AI weather forecasting model, delivering medium-range global forecasts using roughly 1,000 times less energy than traditional physics-based models. The weights are on Hugging Face, available for anyone to use.

But running the current model requires a specific GPU (>Ampere-class), which most people don't have lying around. So we built a compatibility patch to run it on any device. This post walks through how to run AIFS Single 2.0 yourself, using Hugging Face Jobs or your own hardware.

  1. About AIFS models
  2. Practical use-cases
  3. Tutorial: running AIFS single 2.0
  4. Live demo on a HF space: run AIFS forecast on live data

About AIFS models

Numerical weather prediction has traditionally been based on solving the governing equations of atmospheric physics on a discretised grid, integrated forward in time. The European Centre for Medium-Range Weather Forecasts (ECMWF) Integrated Forecasting System (IFS) is one such physics based system. The Artificial Intelligence Forecasting System (AIFS) is a data-driven alternative: rather than integrating the physical equations of the atmosphere as the IFS does, AIFS applies machine learning to historical weather data to learn a statistical representation of atmospheric evolution.

The model uses a graph neural network (GNN) encoder and decoder together with a sliding-window transformer processor, and is trained on Copernicus ERA5 reanalysis, produced by ECMWF, and ECMWF's operational analyses. The encoder maps the input fields onto a compressed latent representation, the processor advances that representation in time, and the decoder projects it back onto the output grid. The models are implemented in Anemoi, an open-source framework developed collaboratively by ECMWF and various European national meteorological services from its Member States.

Two characteristics are relevant for the purposes of this post.

  • First, AIFS is run operationally: ECMWF took it into operations on 25 February 2025, alongside the physics-based IFS, and it is the first fully operational open machine-learning weather model spanning this range of parameters.
  • Second, inference is computationally inexpensive relative to numerical integration: ECMWF estimates that generating a forecast uses on the order of 1,000 times less energy than the physics-based system.

AIFS nonetheless depends on the same initial conditions as the IFS, so it learns how the atmosphere evolves but relies on physics-based data assimilation to establish the initial state.

The system is available in two configurations:

  • AIFS Single, the deterministic model, which produces a single 15-day, 6-hourly global forecast four times per day. Its weights are published under a CC BY 4.0 licence.
  • AIFS ENS, the ensemble model, which became operational on 1 July 2025 and comprises 51 members representing forecast uncertainty.

The current versions are v2. On 12 May 2026, both AIFS Single and AIFS ENS were upgraded to version 2 concurrently with the IFS Cycle 50r1 update. The upgrade introduced ECMWF's first data-driven wave and snow forecasts, an improved representation of the stratosphere, and two additional years of training data.

AIFS 2t & MSL Global field AIFS tcc Global field

Practical use-cases

Releasing the AIFS Single weights under an open licence lowers the barriers for generating a medium-range weather forecast. It opens up new uses for the research and open source community

  • Evaluation and methodological research. With open weights, anyone can generate their own forecasts, inspect individual output variables, and verify results against observations or against IFS. That makes it possible to run studies of past events, use of AIFS as a baseline in comparative experiments, and investigation of the behaviour and failure modes of data-driven models.

  • Application development. The AIFS outputs include variables relevant to specific sectors — for example, surface solar radiation and wind speed at turbine height for renewable-energy applications, and, following the v2 upgrade, wave variables relevant to marine and coastal contexts. Having open access to these fields allows diverse user groups to prototype downstream tools.

  • Teaching. A model that runs on modest hardware is also a model you can teach with. Students can generate a forecast, vary the lead time, tweak the initial conditions, visualise the output, and examine the forecast skill, using the same model deployed operationally.

The operational relevance of AIFS is established independently of these open-use cases. Since September 2025 it has provided input to the Copernicus EFAS and GloFAS flood-awareness systems, and ECMWF reports improvements of up to 20% in tropical cyclone track prediction relative to leading physics-based models. That same model is now openly available to run yourself — the practical obstacle is just the inference tooling, which assumes hardware most people don't have. That's what the rest of this post addresses.

Tutorial: running AIFS single 2.0

The weights for the AIFS have been released publicly on Hugging Face, including the current aifs-single-2.0 checkpoint.

To generate a forecast from the published weights, ECMWF's documentation points to anemoi-inference. However, the AIFS was trained with a dependency on flash-attn, which only compiles on Ampere-class NVIDIA GPUs (A100, H100, RTX 30xx+). For anyone without that specific hardware, installing flash-attn is the main barriers to running inference.

Therefore, we developed this tutorial and a lightweight wrapper to simplify running aifs-single-2.0 with anemoi-inference using Hugging Face jobs or locally on any GPUs or CPUs.

Running AIFS single 2.0 using Hugging Face jobs

Why Hugging Face Jobs are a good fit for the forecasting model?

Hugging Face Jobs let you run inference tasks on Hugging Face infrastructure. This is well adapted to running an AIFS forecast because:

  • You don't need your own GPU or storage. Running inference using AIFS Single v2 checkpoint requires some important RAM and computation power. Jobs provide on-demand access to different flavor of GPUs without any local setup.
  • You get billed by the minute only while the job is "starting" or "running". There is no cost during build, and if a running job starts to fail, it is automatically suspended and billing stops.
  • Results are pushed to a Hugging Face dataset (which you specify, private or public), and can be easily loaded locally or shared.

You can find more details about Hugging Face Jobs and the pricing.

In this tutorial, we use the t4-small flavor (a 16 GB NVIDIA T4, one of the cheapest GPU options available, around $0.40/hour, billed per minute).

0. Getting started with Hugging Face jobs

First install the Hugging Face CLI: run the following command (recommended approch) curl -LsSf https://hf.co/cli/install.sh | bash or using Homebrew: brew install hf or using uv: uv tool install hf

1. Create a dataset to host your results

You need to create a dataset named for example aifs-results in your HF organisation which will store the results of the forecast. To create a dataset, you can use the Hugging Face UI or the huggingface_hub library:

from huggingface_hub import create_repo
create_repo("your-hf-username/aifs-results", repo_type="dataset", token=HF_TOKEN)

2. Login to your Hugging Face account

Create an access token following the documentation. Grant the token with a read / write right on the organisation which owns aifs-results and the permission to manage jobs.

3. Run the forecast

Running a job on Hugging Face: the job will download the latest weather data, load the AIFS model, generate a 48-hour forecast, and save the results in the dataset you specify.

Time expectations: ~10 minutes total (a few minutes to build the container and download the data, less than a minute to run the forecast).

Replace your-hf-username with your actual HF username or organization and run the following command in your terminal:

hf jobs run \
  --flavor t4-small \
  --secrets HF_TOKEN=$HF_TOKEN \
  pytorch/pytorch:2.6.0-cuda12.4-cudnn9-devel \
  bash -c "python -c \"import urllib.request; urllib.request.urlretrieve('https://github.com/huggingface/AIFS-single-2.0-on-all-GPUs/archive/refs/heads/main.tar.gz', 'repo.tar.gz')\" && \
           tar xzf repo.tar.gz && mv AIFS-tutorial-main /app && cd /app && \
           pip install -r requirements.txt huggingface_hub && \
           python run_forecast.py --lead-time 48 --no-plots --dataset-repo your-hf-username/aifs-results"

What did we run?

The command submits a job in three main parts:

  1. Hardware & setup
  • hf jobs run submits a job to Hugging Face infrastructure (like Slurm but on HF cloud)
  • --flavor t4-small picks a 16 GB NVIDIA T4 (~$0.40/hour, billed per minute), which is sufficient for AIFS Single 2.0. Upgrade to gpu-l or a100 if you want faster runs
  • --secrets HF_TOKEN=$HF_TOKEN passes your access token securely, so results can be pushed to your dataset pytorch/pytorch:2.6.0-cuda12.4-cudnn9-devel is the Docker image (pre-installs PyTorch, CUDA, etc.)
  1. Task execution
  • Downloads and extracts the tutorial repository
  • Installs dependencies
  • Runs the forecast with these key arguments:
    • --lead-time 48 = 48-hour forecast (8 steps × 6 hours each)
    • --no-plots = skip image generation (saves time/storage in the job)
    • --dataset-repo your-hf-username/aifs-results = where results are pushed
  1. Monitor and retrieve results: once submitted, track it from your HF account's Jobs page (or run hf jobs logs ). When done, your forecast is in the aifs-results dataset, ready to download or share.

Running AIFS single 2.0 locally

You can also run the models locally. If you have a GPU Ampere, you can follow the example tutorial avaialble of the models' card.

If you have another type of GPU or just CPUs, we built a compatibility patch thanks to which you can run AIFS Single 2.0 on your own machine on any GPU (CUDA or Apple MPS) or on CPU. In a few (technical) words, the compatibility patch lives in aifs/compat.py in the repository: it creates a fake flash_attn module tree and registers it in sys.modules before any Anemoi import can trigger the real package lookup, routing all attention calls to PyTorch's SDPA.

0. Get started with the local setup

Python version: Python ≥3.11, <3.13

git clone https://github.com/huggingface/AIFS-single-2.0-on-all-GPUs
cd aifs-tutorial
pip install -r requirements.txt

1. Check what hardware is available on your device

from aifs import get_device, device_label
print(device_label())
# → "CUDA — NVIDIA A100-SXM4-40GB"
# → "Apple MPS"
# → "CPU (no GPU detected, inference will be slow)"

2. Download Initial Conditions

AIFS needs two consecutive 6-hour analyses as input: t-6h and t. We pull them from ECMWF Open Data (free, no account required).

Multiple datasets are downloaded at this step. Once downloaded for the first time, each dataset is stored in cache. The first download takes a few minutes. Then, loading the data from the cache only takes a few seconds.

During the initial download, ratelimits and errors sometimes occur. If you're getting an error during the downloading of the data, just wait a few seconds and try again.

from aifs import load_ics

fields, date = load_ics(cache_dir="../ic_cache")
# First run: ~3–5 min download, saved to ic_cache/
# Later runs: <1 s from local .npz cache

print(date)  
print(fields["2t"].shape)

Fields downloaded: surface, soil, ocean waves, pressure levels, plus derived quantities (geopotential, wave direction components).

3. Run a Forecast

Depending on your hardware, running the forecast can take more or less time. For example, it takes a few seconds per step on a Apple M5 pro.

from aifs import run_forecast

states = run_forecast(
    fields,
    date,
    lead_time=24,  
    num_chunks=16, 
)

Each call to run_forecast returns a list of state dicts — one per 6-hour output step:

for state in states:
    print(state["date"], state["fields"]["2t"].mean() - 273.15, "°C")
# 2025-01-15 06:00:00   14.32 °C
# 2025-01-15 12:00:00   14.38 °C
# 2025-01-15 18:00:00   14.41 °C
# 2025-01-16 00:00:00   14.29 °C

4. Plot Forecast Fields

from aifs import plot_field, plot_field_sequence

# Single map
fig = plot_field(states[0], "2t")
fig.savefig("t2m_T+6h.png", dpi=150)

# Four-panel sequence
fig = plot_field_sequence(states, "msl", max_steps=4)
fig.savefig("msl_sequence.png", dpi=150)

image

CLI Usage

# 24-hour forecast, save plots to ./outputs/
python run_forecast.py

# 48-hour forecast
python run_forecast.py --lead-time 48 --fields 2t msl z_500

# List IC cache
python run_forecast.py --list-cache

# Force re-download
python run_forecast.py --force-download

Notebook

The whole tutorial is also available as a runnable notebook in the repository in notebooks/tutorial.py, which walks through device detection, downloading the initial conditions, running the forecast, and plotting the resulting fields.

Live demo on a HF space: run AIFS forecast on live data

We built a live demo of the forecast of AIFS single 2.0 which can be run by anyone here: AIFS-single-2.0-space

The Space wraps the exact same code as the tutorial above and runs it on ZeroGPU.

Here is how it works:

  1. Choose your forecast settings. Pick how many hours ahead you want to predict (the lead time, in 6-hour steps) and the memory settings (the number of chunks — the same num_chunks parameter as in the local tutorial, which trades speed for memory usage).
  2. The app fetches live initial conditions. It downloads the two most recent 6-hour analyses (t-6h and t) from ECMWF Open Data, meaning every forecast you run starts from the real, current state of the atmosphere.
  3. The forecast runs step by step. The app loads the AIFS Single 2.0 checkpoint and produces the forecast states one 6-hour step at a time.
  4. Visualise the results. Once the run completes, you can plot the forecast fields, such as 2m temperature , mean sea-level pressure, 10m winds or significant wave height and visualise it on a map.

In other words: you can run AIFS single 2.0 and get the weather forecast of the next days from today's atmosphere, in your browser

Contacts

If you have any questions or would like to contribute, feel free to open a github issue or to contact us:

Community

Sign up or log in to comment