Before the Taiho Ritsuryo (Taiho Code), it was a government office called Zenshiki, but when Taiho Ritsuryo was formulated it was divided into Naizenshi (Imperial Table Office) which served Emperor's food and Daizenshiki which served hospitable foods.
大宝律令以前は膳職という官司であったが、大宝律令制定時に、天皇の食事を掌る内膳司と饗膳の食事を掌る大膳職に分割された。