You have a choice at 1 am to either go to sleep or not.
Once you've realized it's 1 am, that should trigger some response in you to go to sleep. Other wise, you're not going to do it any ways, and you have to suffer the opportunity cost of staying up.
Last night I was in that same boat. I wanted to stay up and work on some mastering (i just bought a maximizer and wanted to test it out), but i realized i was sleepy as hell.
But i did make great progress on one song that i've been literally listening to for months, and realized i had this weird frequency build up in my reverb buss. So i had to change it to post instead of pre fader settings.
regardless, when i decided to do that, i quickly fell asleep.
So, decide and stick by your choices lol