While the artificial intelligence (AI) hype cycle has driven some stock prices through the roof, others have only seen a modest gain or none at all. But some of these companies will still benefit from AI and should be considered alternative plays that allow investors to avoid overpaying for stocks with real upside.

Two companies that meet this description are Taiwan Semiconductor Manufacturing (TSM 1.26%) and DigitalOcean Holdings (DOCN 3.30%). I think each is a great buy right now because they haven't seen the incredible AI run-up that others have. Read on to find out more about these two solid investments.

1. Taiwan Semiconductor

It takes a lot of computing power to create AI models, which means customers will have to beef up their infrastructure with the latest graphics processing units (GPUs) from Nvidia or AMD. With Nvidia's stock drastically overvalued from the demand surge and AMD not as concentrated in AI, they might make for OK investments, but not as good as Taiwan Semiconductor.

TSMC, as it's also known, is the primary supplier for both companies' chips and has cutting-edge technology like 3-nanometer (3nm) and 5nm processes. These chips are more powerful and efficient than their predecessors, making them the choice for the latest AI technology.

TSMC shares have seen some rise since Nvidia's groundbreaking second-quarter guidance shook the world: The stock is up 15% since. And there could be room for more.

For the second quarter, TSMC guided for revenue between $15 billion to $16 billion. That would imply a year-over-year decline of 15% in U.S. dollars at the midpoint. This guidance is representative of a poor PC market and weakening consumers, but that is starting to turn around.

Taiwan Semiconductor reports monthly revenue and saw a significant trend reversal in May with 19.4% growth in local currency over April.

With TSMC's growth looking like it is accelerating over prior months, June's revenue would have to fall 8.4% compared to May's number for the company to come in at the top end of its revenue guidance. I don't see that happening with rising AI demand, and the company is well positioned for a substantial revenue beat.

With the stock trading at a historically reasonable 16 times forward earnings, investors can confidently take a position in a company that will benefit from AI proliferation, regardless of which GPU or software company a customer buys products from.

2. DigitalOcean

Training AI models isn't easy work for a traditional PC. Any user interested in learning the fundamentals of AI, like machine learning (ML), often needs to bulk up on computing power, and that requires turning to the cloud. By renting a computer off-site, a user can access more computing power at an affordable rate.

While many of the largest tech companies have their cloud computing offering, they don't specialize in catering to a small business or an individual user. That's where DigitalOcean comes in. With more than 147,000 customers (up 43% year over year), it has a large following that uses its cloud computing capabilities.

As AI becomes more integrated into business platforms, DigitalOcean will likely see increased demand, as clients will have to upgrade to more powerful systems to run their models.

This will help boost its business, although it's already doing quite well for itself. In the first quarter, revenue rose 30%, and the company produced positive free cash flow, although it is still unprofitable. But it is moving in the right direction, as its operating expenses only rose 12% once one-time restructuring charges are removed from the equation.

Cloud computing is a massive market opportunity and is expected to increase rapidly over the next decade. With DigitalOcean playing in a vital portion of that market (individual developers and small businesses), it has a long growth runway. Still, the stock trades at a cheap valuation.

DOCN PS Ratio Chart

DOCN PS Ratio data by YCharts. PS = price to sales.

DigitalOcean is a reasonably priced stock at 7 times sales that could see increased business thanks to the AI boom. I think it's an excellent buy here, but investors must hold on to it for a few years to fully realize its potential.