The buzz around artificial intelligence has investors pouring a record amount of money into tech stocks, Bank of America Corp. says.

A “baby bubble” in AI was the dominant market theme in May, strategist Michael Hartnett said, with tech funds attracting an all-time high of $8.5 billion in the week through May 31, according to the bank citing EPFR Global data.

“Monopolistic tech” is winning through pricing power and the squeeze on smaller suppliers, Hartnett wrote in a note, highlighting the Nasdaq 100 Index is now at a record high relative to the Russell 2000 small-cap index. The contrarian trade at this point would be to sell AI and buy Hong Kong shares, he added.

Flows into global equity funds overall hit $14.8 billion, while $1.1 billion went into bond funds, the data show.

Tech stocks have surged 32% this year on wagers the Federal Reserve will stop raising rates, and that the sector will be more immune to an expected recession. Optimism around AI-related stocks gave tech an additional boost in May, briefly sending Nvidia Corp.’s market capitalization to $1 trillion, while Apple Inc. is back near record highs.

The sharpness of the rally is now raising some flags on technicals and positioning. The Nasdaq 100’s relative strength index is back above 70, the threshold for overbought, which some consider a precursor to a selloff. Long positions in Nasdaq 100 futures are also at the highest in three years, increasing the risk of a rout, Citigroup Inc. strategists said earlier this week.

Nasdaq 100 futures trimmed gains on Friday after data showed US payrolls rose well above forecasts in May, putting pressure on the Fed to keep rates elevated.

BofA’s Hartnett — who correctly predicted the stock slump in 2022 — said he remains bearish on stocks overall amid the prospect of tightening financial conditions.

--With assistance from Michael Msika.

This article was provided by Bloomberg News.