AbstractScientists and engineers employ stochastic numerical simulators to model empirically observedphenomena. In contrast to purely statistical models, simulators express scientific principles thatprovide powerful inductive biases, improve generalization to new data or scenarios and allow forfewer, more interpretable and domain-relevant parameters. Despite these advantages, tuninga simulator’s parameters so that its outputs match data is challenging. Simulation-basedinference (SBI) seeks to identify parameter sets that a) are compatible with prior knowledgeand b) match empirical observations. Importantly, SBI does not seek to recover a single ‘best’data-compatible parameter set, but rather to identify all high probability regions of parameterspace that explain observed data, and thereby to quantify parameter uncertainty. In Bayesianterminology, SBI aims to retrieve the posterior distribution over the parameters of interest. Incontrast to conventional Bayesian inference, SBI is also applicable when one can run modelsimulations, but no formula or algorithm exists for evaluating the probability of data givenparameters, i.e. the likelihood.We presentsbi, a PyTorch-based package that implements SBI algorithms based on neu-ral networks.sbifacilitates inference on black-box simulators for practising scientists andengineers by providing a unified interface to state-of-the-art algorithms together with docu-mentation and tutorials.