H21F (Hierachical Gaussian process 21 cm Foreground removal) implements a hierarchical Gaussian process framework for separating cosmological 21-cm signals from bright astrophysical foregrounds in simulated HI intensity-mapping datasets. It uses Bayesian sampling with spatially varying Gaussian process kernel parameters to model foregrounds and the faint 21-cm emission, supporting no-pooling, conventional global, and hierarchical variants of the model. The code provides notebooks and scripts for sampling, component separation, prediction, and evaluation, and includes tools to visualize recovered signals, compute residuals, and estimate power spectra from the separated components. H21F leverages JAX (
ascl:2111.002) and NumPyro (
ascl:2505.005) for non-parametric model inference and supports modular analysis workflows.