A mechanistic model for the description of helium swelling and tritium release in neutron-irradiated beryllium is presented. Initially aimed at predicting the mechanical stability and the tritium retention capacity of beryllium in a fusion reactor blanket, the ANFIBE code was finally extended to provide an exhaustive description of the properties of this material under fast neutron irradiation. In-solid diffusion and precipitation of helium and tritium, radiation re-solution, and bubble growth and coalescence in different structural domains of the material are taken into account and formulated in a compact rate equation system, enabling the evolution of swelling and release to be calculated under stationary and nonstationary irradiation and temperature conditions. A particular feature of the model is the treatment of the growth of gas bubbles and pores in the interactive compressive stress field created by the gas precipitated in cavities of different sizes and at different pressures, enabling a realistic and accurate calculation of the stress-sensitive intergranular-swelling components and of the related pore-venting effects. The salient physical hypotheses of the model are discussed, as well as the formalism adopted for the description of helium and tritium diffusion precipitation and swelling.