Tuned mass dampers (TMD) are installed in base-isolated building to suppress the excessive isolator displacement and acceleration responses of primary structure. By incorporating an inerter element into the original configuration, the seismic performance of TMD is significantly enhanced. In this work, optimal solutions of tuned mass damper inerter (TMDI) for improving the seismic resilience of base-isolated building are proposed. The analytical formulations of optimal design of TMDI are respectively developed to minimize the H2 norm of the displacement of primary structure relative to the base floor and the isolator displacement. The performance of presented optimal methods are validated by using stationary responses under the stochastic excitations. Additionally, the seismic performance of TMDI with parameters obtained from the proposed method are compared with the established methods.