by the time of ptolemy iii , in 246 bce , there were two locations-the main library near the royal palace and another , smaller one headquartered in the sanctuary of the god serapis , known as the serapeum .