OlmoEarth Pretrain Minimal
A minimal package for loading and initializing OlmoEarth models. This package contains only the code necessary to load models from Hugging Face or initialize them with random weights, without training or evaluation dependencies.
Installation
Option 1: Install from PyPI
pip install olmoearth-pretrain-minimal
Option 2: Install from source with uv
Install uv if you haven't already:
curl -LsSf https://astral.sh/uv/install.sh | sh
To install dependencies:
git clone git@github.com:allenai/olmoearth_pretrain_minimal.git
cd olmoearth_pretrain_minimal
uv sync
uv installs everything into a venv, so to keep using python commands you can activate uv's venv: source .venv/bin/activate. Otherwise, swap to uv run python.
Note: You must specify either --extra torch-cpu or --extra torch-cu128 to install PyTorch. This allows you to explicitly choose the CPU or GPU version regardless of your platform, which is especially useful for CI environments that need CPU-only builds on Linux.
Model Summary
The OlmoEarth models are trained on three satellite modalities (Sentinel 2, Sentinel 1 and Landsat) and six derived maps (OpenStreetMap, WorldCover, USDA Cropland Data Layer, SRTM DEM, WRI Canopy Height Map, and WorldCereal).
Note: the derived maps were decode-only during pretraining: the decoder learned to predict them, but the encoder never saw them as inputs. Models loaded with load_model_from_id or load_model_from_path therefore only ingest Sentinel 2, Sentinel 1 and Landsat; any other modality passed in a sample is dropped from the encoder input (with a warning), since encoding modalities the model was not trained on degrades results.
The model weights are released under the OlmoEarth Artifact License
v1
v1 is described in the original OlmoEarth report.
| Model Size | Weights | Encoder Params | Decoder Params |
|---|---|---|---|
| Nano | link | 1.4M | 800K |
| Tiny | link | 6.2M | 1.9M |
| Base | link | 89M | 30M |
| Large | link | 308M | 53M |
v1.1
v1.1 is described in the OlmoEarth v1.1 tech report.
| Model Size | Weights | Encoder Params | Decoder Params |
|---|---|---|---|
| Nano | link | 1.7M | 800K |
| Tiny | link | 12.5M | 1.9M |
| Base | link | 114M | 30M |
v1.2
v1.2 is described in the OlmoEarth v1.2 tech report.
| Model Size | Weights | Encoder Params | Decoder Params |
|---|---|---|---|
| Nano | link | 1.7M | 800K |
| Tiny | link | 12.5M | 1.9M |
| Small | link | 35.6M | 7.4M |
| Base | link | 114M | 30M |
v1.3
v1.3 is described in the OlmoEarth v1.3 tech report.
It adds an AttentionPooler on top of the v1.2 encoder, which pools the encoder's
patch tokens into a grid of location tokens (returned under location_tokens in the
encoder output).
| Model Size | Weights | Encoder Params | Decoder Params |
|---|---|---|---|
| Base | link | 128M | 30M |
Usage
Loading Models from Hugging Face
The recommended way to load models is using the model loader, which downloads the model configuration from Hugging Face:
from olmoearth_pretrain_minimal import ModelID, load_model_from_id
# Load a model from Hugging Face with pre-trained weights
# - ModelID.OLMOEARTH_V1_NANO - 1.4M encoder params, 800K decoder params
# - ModelID.OLMOEARTH_V1_TINY - 6.2M encoder params, 1.9M decoder params
# - ModelID.OLMOEARTH_V1_BASE - 89M encoder params, 30M decoder params
# - ModelID.OLMOEARTH_V1_LARGE - 308M encoder params, 53M decoder params
# v1.1 models available at ModelID.{OLMOEARTH_V1_1_NANO, OLMOEARTH_V1_1_TINY, OLMOEARTH_V1_1_BASE}
# v1.2 models available at ModelID.{OLMOEARTH_V1_2_NANO, OLMOEARTH_V1_2_TINY,
# OLMOEARTH_V1_2_SMALL, OLMOEARTH_V1_2_BASE}
# v1.3 models available at ModelID.OLMOEARTH_V1_3_BASE
model = load_model_from_id(ModelID.OLMOEARTH_V1_BASE, load_weights=True)
# Load with randomly initialized weights
model_with_weights = load_model_from_id(ModelID.OLMOEARTH_V1_NANO, load_weights=False)
Direct Model Initialization (Custom Configuration)
For custom configurations (e.g., custom modalities), you can directly instantiate the model class:
from olmoearth_pretrain_minimal import OlmoEarthPretrain_v1
# Initialize with custom modalities and settings
model = OlmoEarthPretrain_v1(
model_size="nano",
supported_modality_names=["sentinel2_l2a", "sentinel1", "landsat"],
max_patch_size=8,
max_sequence_length=12,
drop_path=0.1,
)
Manual Weight Loading
If you have pre-trained weights in a separate file, you can load them manually:
from olmoearth_pretrain_minimal import ModelID, load_model_from_id
import torch
# Load model without weights
model = load_model_from_id(ModelID.OLMOEARTH_V1_NANO, load_weights=False)
# Load pre-trained weights from a separate file
weights = torch.load("path/to/weights.pth")
model.load_state_dict(weights)
Data Normalization
The model expects normalized input data. Use the Normalizer class to normalize your data before passing it to the model.
Note: Data must be provided with bands in the specific order expected by each modality. See the band order section below.
Sample Code
import torch
import numpy as np
from olmoearth_pretrain_minimal import load_model_from_id, ModelID, Normalizer
from olmoearth_pretrain_minimal.olmoearth_pretrain_v1.utils.constants import Modality
from olmoearth_pretrain_minimal.olmoearth_pretrain_v1.utils.datatypes import MaskedOlmoEarthSample
# Initialize normalizer
normalizer = Normalizer(std_multiplier=2.0)
# Prepare Sentinel-2 L2A data: (batch, height, width, time, bands)
# Bands must match Modality.SENTINEL2_L2A.band_order (12 bands)
sentinel2_data = np.random.rand(1, 128, 128, 12, 12).astype(np.float32)
# Normalize the data
normalized_sentinel2 = normalizer.normalize(Modality.SENTINEL2_L2A, sentinel2_data)
model = load_model_from_id(ModelID.OLMOEARTH_V1_BASE, load_weights=True)
model.eval()
# Create minimal sample (timestamps required, month must be long for embedding)
timestamps = torch.zeros(1, 12, 3, dtype=torch.long)
timestamps[:, :, 1] = torch.arange(12, dtype=torch.long) # months 0-11
sample = MaskedOlmoEarthSample(
timestamps=timestamps,
sentinel2_l2a=torch.from_numpy(normalized_sentinel2).float(),
sentinel2_l2a_mask=torch.zeros(1, 128, 128, 12, dtype=torch.long),
)
with torch.no_grad():
output = model.encoder(sample, patch_size=8, input_res=10, fast_pass=True)
Expected Band Orders
The model expects data with bands in a specific order for each modality. Use Modality.<MODALITY_NAME>.band_order to get the correct order:
from olmoearth_pretrain_minimal.olmoearth_pretrain_v1.utils.constants import Modality
# Sentinel-2 L2A band order (12 bands)
print(Modality.SENTINEL2_L2A.band_order)
# ['B02', 'B03', 'B04', 'B08', 'B05', 'B06', 'B07', 'B8A', 'B11', 'B12', 'B01', 'B09']
# Sentinel-1 band order (2 bands)
print(Modality.SENTINEL1.band_order)
# ['vv', 'vh']
# Landsat band order (11 bands)
print(Modality.LANDSAT.band_order)
# ['B8', 'B1', 'B2', 'B3', 'B4', 'B5', 'B6', 'B7', 'B9', 'B10', 'B11']
# WorldCover band order (1 band)
print(Modality.WORLDCOVER.band_order)
# ['B1']
# SRTM band order (1 band)
print(Modality.SRTM.band_order)
# ['srtm']
Key points:
- The last dimension of your data array must match the band order exactly
- For multitemporal modalities (Sentinel-2, Sentinel-1, Landsat), data shape is
(batch, height, width, time, bands) - For single-temporal modalities (WorldCover, SRTM, etc.), data shape is
(batch, height, width, bands)
Missing Bands
Keep every band in its place in the band order and mark missing values as NaN (or
MISSING_VALUE from utils.constants). Then tell the normalizer which model the data
is for, so it fills missing bands the way that model expects:
from olmoearth_pretrain_minimal import NormalizerV1, NormalizerV1_2
normalized = NormalizerV1_2().normalize(Modality.SENTINEL2_L2A, data) # v1.2
normalized = NormalizerV1().normalize(Modality.SENTINEL2_L2A, data) # v1
There is one per model version (NormalizerV1, NormalizerV1_1, NormalizerV1_2,
NormalizerV1_3); Normalizer(model_type="v1.2") and so on are the same.
- v1.1 and later were trained with band dropout, so missing bands are set to 0 after normalization, which is what the model saw for dropped bands.
- v1 was not, so each missing value is copied from the present band nearest to it in wavelength at the same pixel and timestep (e.g. B01 from B02, B09 from B8A) before normalizing, as the olmoearth_pretrain evals do. This applies to Sentinel-2 and Landsat, with thermal bands only copied from thermal bands. Values that cannot be copied are set to 0.
A UserWarning is raised when more than 20% of a modality's bands are filled at a
pixel and timestep (Sentinel-2 without B01 and B09 does not warn; Sentinel-2 with only
RGB and NIR does), and for v1 whenever values are set to 0.
If a whole band set (or timestep) has no data, either leave it out or mark it
MaskValue.MISSING in the modality's mask so the encoder does not attend to it.
Normalizer() without a model_type does not fill missing values. Data with the
wrong number of bands raises an error rather than being misread.
Note
For the full package with training and evaluation capabilities, see the main olmoearth_pretrain package.
Metadata
Release files for olmoearth-pretrain-minimal 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| olmoearth_pretrain_minimal-0.1.5.tar.gz | 116.6 kB | With provenance | Details for olmoearth_pretrain_minimal-0.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| olmoearth_pretrain_minimal-0.1.5-py3-none-any.whl | Python 3 | none | any | Details for olmoearth_pretrain_minimal-0.1.5-py3-none-any.whl |
Total release size: 224.2 kB
Release files / olmoearth_pretrain_minimal-0.1.5.tar.gz
| Download URL | olmoearth_pretrain_minimal-0.1.5.tar.gz |
|---|---|
| Size | 116.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
45bc2f8f7f9df7599cb55abc9f4f31aa9227e252165015427bd2bdc814549258
|
|
BLAKE2b-256 checksum How to use checksums |
fa28fcb0c1925e98afca40b183911adb9c747357dadcd5febb8747c5dfbe81b7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.
Transparency logRelease files / olmoearth_pretrain_minimal-0.1.5-py3-none-any.whl
| Download URL | olmoearth_pretrain_minimal-0.1.5-py3-none-any.whl |
|---|---|
| Size | 107.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
62664d578a97527eb6a26f9ded928bb9b292e2b701a118c46f3bed9a323781d4
|
|
BLAKE2b-256 checksum How to use checksums |
bf3c9377c4f4051f1c0fb5c2e3d5655013002a40cf1ed092631e27d2750e0cbf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.
Transparency logSecurity for olmoearth-pretrain-minimal 0.1.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for olmoearth_pretrain_minimal-0.1.5.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.