Abstract Most of the observed galaxies cannot be resolved into individual stars and are studied through their integrated spectrum using simple stellar populations (SSPs) models, with stellar libraries being a key ingredient in building them. Spectroscopic observations are increasingly being directed towards the near-infrared (NIR), where much is yet to be explored. SSPs in the NIR are still limited, and there are inconsistencies between different sets of models. One of the ways to minimize this problem is to have reliable NIR stellar libraries. The main goal of this work is to present smarty (mileS Moderate resolution neAr-infRared sTellar librarY) a ∼0.9 − 2.4 μm stellar spectral library composed of 31 stars observed with the Gemini Near-IR Spectrograph (GNIRS) at the 8.1 m Gemini North telescope and make it available to the community. The stars were chosen from the miles library, for which the atmospheric parameters are reliable (and well tested), to populate different regions of the Hertzsprung-Russell (HR) diagram. Furthermore, five of these stars have NIR spectra available that we use to assess the quality of smarty. The remaining 26 stars are presented for the first time in the NIR. We compared the observed smarty spectra with synthetic and interpolated spectra, finding a mean difference of $\sim 20\%$ in the equivalent widths and ∼1% in the overall continuum shape in both sets of comparisons. We computed the spectrophotometric broadband magnitudes and colours and compared them with the 2MASS ones, resulting in mean differences up to 0.07 and 0.10 mag in magnitudes and colours, respectively. In general, a small difference was noted between the smarty spectra corrected using the continuum from the interpolated and the theoretical stars.