  In this work, we study the evolution of the mass-metallicity relations (MZRs)
as predicted by the GAlaxy Evolution and Assembly (GAEA) semi-analytic model.
We contrast these predictions with recent results from the VANDELS survey, that
allows us to expand the accessible redshift range for the stellar MZR up to
$z\sim3.5$. We complement our study by considering the evolution of the
gas-phase MZR in the same redshift range. We show that GAEA is able to
reproduce the observed evolution of the $z<3.5$ gas-phase MZR and $z<0.7$
stellar MZR, while it overpredicts the stellar metallicity at $z\sim3.5$.
Furthermore, GAEA also reproduces the so-called fundamental metallicity
relation (FMR) between gas-phase metallicity, stellar mass and star formation
rate (SFR). In particular, the gas-phase FMR in GAEA is already in place at
$z\sim5$ and shows almost no evolution at lower redshift. GAEA predicts the
existence of a stellar FMR, that is, however, characterized by a relevant
redshift evolution, although its shape follows closely the gas-phase FMR. We
also report additional unsolved tensions between model and data: the overall
normalization of the predicted MZR agrees with observations only within
$\sim$0.1 dex; the largest discrepancies are seen at $z\sim3.5$ where models
tend to slightly overpredict observed metallicities; the slope of the predicted
MZR at fixed SFR is too steep below a few ${\rm M}_\odot\ {\rm yr}^{-1}$.
Finally, we provide model predictions for the evolution of the MZRs at higher
redshifts, that would be useful in the context of future surveys, like those
that will be performed with JWST.
