Spin-phonon coupling in intermediate valency: exactly solvable models