AbstractWe introduce a class of quantum integrable systems generalizing the Gaudin model. The corresponding algebras of quantum Hamiltonians are obtained as quotients of the center of the enveloping algebra of an affine Kac–Moody algebra at the critical level, extending the construction of higher Gaudin Hamiltonians from B. Feigin et al. (1994) [17] to the case of non-highest weight representations of affine algebras. We show that these algebras are isomorphic to algebras of functions on the spaces of opers on P1 with regular as well as irregular singularities at finitely many points. We construct eigenvectors of these Hamiltonians, using Wakimoto modules of critical level, and show that their spectra on finite-dimensional representations a...