init a codebook manager