That's obviously the holy grail with any trend : getting in on the upside and getting out (or turning short) right at the top. Kudos for trying and I wish you great success but how many people have been consistently able to do that in history? I worry you might be trying to be too smart for your own good.
If you think there is a bubble of irrationality in a certain part of the market, just stay out of that part and find something else that you like at a price that you think is fair or cheap in another unrelated industry. Because the second you decide to "play" it, whether long or short, you make yourself dependent on that very crowd of irrational price setters that send shoe companies to the Moon. I don't personally think we're in an AI bubble but, for example, I've never believed in cryptocurrencies and I've always considered Tesla to be overvalued by a factor of at least 10x. Right or wrong, I still feel the same 10 years later, but boy has the market taken the other view! How could I possibly gauge when the tide will turn around since it's based on nothing but crowd mania? I don't have any control over those people and I have no idea what might make change their minds and when. And most importantly how do I avoid getting doubly smoked if I'm wrong? I remember some famous investor was short Tesla and long GM like a decade ago. He had a whole deck that made a lot of sense on paper.
I became a better investor once I decided I should focus on making money and not on feeling smarter than others. I realized there was a lot of misplaced ego involved in my contrarianism.