We formulate and prove the weight part of Serre's conjecture for three-dimensional mod p Galois representations under a genericity condition when the field is unramified at p. This removes the assumption in \cite{arXiv:1512.06380}, \cite{arXiv:1608.06570} that the representation be tamely ramified at p. We also prove a version of Breuil's lattice conjecture and a mod p multiplicity one result for the cohomology of U(3)-arithmetic manifolds. The key input is a study of the geometry of the Emerton--Gee stacks \cite{arXiv:2012.12719} using the local models introduced in \cite{arXiv:2007.05398}.