Metasurfaces provide the disruptive technology enabling miniaturization of complex cascades of optical elements on a plane. We leverage the benefits of such a surface to develop a planar integrated photonic beam collimator for on-chip optofluidic sensing applications. While most of the current work focuses on miniaturizing the optical detection hardware, little attention is given to develop on-chip hardware for optical excitation. In this manuscript, we propose a flat metasurface for beam collimation in optofluidic applications. We implement an inverse design approach to optimize the metasurface using gradient descent method and experimentally compare its characteristics with conventional binary grating-based photonic beam diffractors. The proposed metasurface can enhance the illumination efficiency almost two times in on-chip applications such as fluorescence imaging, Raman and IR spectroscopy and can enable multiplexing of light sources for high throughput biosensing.