Try to cut off the caffeine consumption by 3pm and your sleep should not suffer (based on the half life of caffeine and average human adult body weight).
Disclaimer: I consume ~4 cups of coffee per day between 8am and 3pm and get ~8 hours of sleep per night.
Disclaimer: I consume ~4 cups of coffee per day between 8am and 3pm and get ~8 hours of sleep per night.