A near-infrared, high order pyramid wavefront sensor will be implemented on the Keck telescope, with the aim of providing high resolution adaptive optics correction for the study of exoplanets around M-type stars and planet formation in obscured star forming regions. The pyramid wavefront sensor is designed to support adaptive optics correction of the light to an imaging vortex coronagraph and to a fiber injection unit that will feed a spectrograph. We present the opto-mechanical design of the near-infrared pyramid wavefront sensor, the optical performance, and the alignment strategy. The challenges of designing the assembly, as well as a fiber injection unit, to fit into the limited available space on the Keck adaptive optics bench, will also be discussed.