The construction of optimal locally repairable codes is of both theoretical interest and practical importance. A class of codes constructed earlier and known as pyramid codes [1]} are shown to be optimal locally repairable codes. In [2]}, Silberstein et al. proposed a two-level construction based on the Gabidulin codes combined with a single parity-check \((r+1,r)\)  code. Another construction [3]} used two layers of MDS codes, a Reed-Solomon code and a special \((r+1,r)\)  MDS code. A common shortcoming of these constructions is that the size of the code alphabet is an exponential function of the code length, and complicating the implementation. There was an earlier construction of optimal locally repairable codes given in [4]} with alphabet size comparable to code length. However, the rate of the code is very close to 1.
