We present three-dimensional eccentric disc models of the nucleus of M31, modelling the disc as a linear combination of thick rings of massless stars orbiting in the potential of a central black hole. Our models are nonparametric generalisations of the parametric models of Peiris & Tremaine. The models reproduce well the observed WFPC2 photometry, the detailed line-of-sight velocity distributions from STIS observations along P1 and P2, together with the qualitative features of the OASIS kinematic maps. We confirm Peiris & Tremaines finding that nuclear discs aligned with the larger disc of M31 are strongly ruled out. Our optimal model is inclined at 57 degrees with respect to the line of sight of M31 and has a position angle of 55 degrees. It has a central black hole of mass 10^8 solar masses, and, when viewed in three dimensions, shows a clear enhancement in the density of stars around the black hole. The distribution of orbit eccentricities in our models is similar to Peiris & Tremaines model, but we find significantly different inclination distributions, which might provide valuable clues to the origin of the disc.