精 here borrows the sense of 'a sprite/spirit' from folklore —
狐狸精 (fox spirit),
妖精 (demon spirit) — and applies it admiringly (or warily) to a kid who is freakishly clever beyond their years. Affectionate by default, but can carry a tinge of 'too clever for their own good.'