We provide an optimal control framework for efficiently coupling light in a bare fiber into Bragg gratings with an appreciable Kerr nonlinearity. The light-grating interaction excites gap solitons, a type of localized nonlinear coherent state which propagates with a central frequency in the forbidden band gap, resulting in a dramatically slower group velocity. Due to the nature of the band gap, a substantial amount of light is back-reflected by the grating’s strong reflective properties. We optimize, via a projected gradient descent method, the transmission efficiency of previously designed nonuniform grating structures in order to couple more slow light into the grating. We further explore the space of possible grating designs, using genetic algorithms, along with a previously unexplored design parameter: the grating chirp. Through these methods, we find structures which couple a greater fraction of light into the grating with the added bonus of creating slower pulses.