There are so many words but depends on whether it is positive or negative.
bookworm, geek, nerd has negative connotations.
savant, scholarly, intellect, learned, erudite, etc has positive nuances.
Of course, depending on how your tone and intentions, it can be become positive or negative. "You silly little geek of mine", the mother said to her son. Now "geek" takes on a positive and loving meaning.