The CARMENES (Calar Alto high-Resolution search for M dwarfs with Exo-earths with Near-infrared and optical Echelle Spectrographs) consortium, consisting of eleven Spanish and German institutions, has been established to conduct a radial-velocity survey of M dwarfs with the 3.5 m telescope at the Calar Alto Observatory. This survey will target ～300 M stars, with emphasis on spectral types M4V and later. The CARMENES instrument is currently under construction; it consists of two independent échelle spectrographs covering the wavelength ranges 0.55 …1.05 μm and 0.95 …1.7 μm, respectively, at a spectral resolution of R = 82,000. The spectrographs are fed by fibers from the Cassegrain focus of the telescope; calibration is performed simultaneously with emission-line lamps. The optical benches of the spectrographs are housed in vacuum tanks and climatic chambers, which provide the temperature-stabilized environments necessary to enable a 1 m/s radial velocity precision.