Tesla is at a crossroads. Its EV sales are declining, and new models like the Cybertruck have been a commercial flop.

It is betting the house on speculative self-driving and humanoid robot technologies. All the while, CEO Elon Musk is investing in artificial intelligence (AI), but through an entirely different company: xAI.

It looks like a tough road ahead for the once-beloved brand. Here's why investors should forget it and buy two other AI stocks instead.

A phone with a screen saying AI on it with a coffee in the background.

Image source: Getty Images.

ASML's manufacturing tailwinds

Companies such as xAI are investing billions of dollars in advanced computer chips. In order to meet this demand, manufacturers are increasing chipmaking capacity in the U.S. and other countries around the world. This will be a boon for ASML Holding (ASML -1.85%).

ASML is the leader in making lithography machines for semiconductors, which help build intricate patterns on silicon wafers. The company's extreme ultraviolet lithography (EUV) systems are the only way that advanced computer chips designed by the likes of Nvidia can be made en masse.

This gives the company a large demand tailwind from AI and huge power over the semiconductor supply chain. It's why it can sell its machines for hundreds of millions of dollars with over 50% gross margins.

Traders sold off ASML stock recently after its second-quarter earnings update and tentative guidance due to U.S. tariffs. However, the company is still guiding for 15% net sales growth this year and 44 billion to 60 billion euros ($51.5 billion to $70.3 billion) in revenue by 2030.

It also expects gross margins to keep ticking higher at greater scale, with guidance for upward of 60%. This could help operating margins leap to 40% compared to 36% over the last 12 months.

A 40% operating margin on $70.3 billion in revenue equates to $28 billion in operating income. Compared to a market cap of $280 billion today, this earnings potential means that ASML stock is cheap after its latest drawdown and deserves consideration in one's portfolio.

ASML PE Ratio Chart

ASML PE Ratio data by YCharts; PE = price to earnings.

A historical opportunity for Google

Alphabet (GOOG 0.45%) (GOOGL 0.54%) is a huge driver of demand for computer chips and ASML's machines as one of the leading AI companies. As the owner of Google, YouTube, and Google Cloud, the technology giant is in prime position to take advantage of this historical opportunity.

It can create consumer demand through new products such as Google AI Overviews and its Gemini chatbot, which are both seeing an extreme increase in use at the moment. Only Alphabet has the in-house computing infrastructure to support so many people using its products at once.

AI growth can drive revenue to new heights for Google and associated consumer products like YouTube. Last quarter, Google Services revenue increased 10% year-over-year to $77 billion.

More promising may be Alphabet's outsourcing of AI computing infrastructure through Google Cloud. It has spent years investing in chips and data centers focused on AI computing, which is now helping it gain market share in cloud spending.

Google Cloud revenue increased 28% year over year last quarter to $12.3 billion. It is much smaller than Google Services today, but it has a huge runway left as AI proliferates in the software industry over the next decade and beyond.

Even though it is already one of the largest companies in the world, Alphabet can use AI to drive further revenue and earnings increases in the next decade. At a price-to-earnings ratio (P/E) of just 21, the stock looks like an appetizing buy.

Both these companies look like much better bets than Tesla. ASML has a P/E of 26, while Tesla's is over 180. ASML and Alphabet are growing; Tesla isn't at the moment. If you own the EV maker, it might be time to start thinking about better replacements in your portfolio to play the AI boom.