The artificial intelligence (AI) market will have a significant impact on economic productivity and growth. It is a ripe field to find long-term winners, but as with any new technology, there will be winners and losers. A simple criteria to stack the odds in your favor is to invest in AI leaders that are turning a profit and generating loads of free cash flow from operations.

Two that come top to mind are AI chip leader Nvidia (NVDA 0.03%) and Google parent Alphabet (GOOG -3.33%) (GOOGL -3.37%). There are probably no other companies spending more on AI technology than these two. Their current valuations seem cheap relative to their growth and could deliver spectacular returns over the next decade.

1. Nvidia

Shares of Nvidia have soared 254% over the last year, as its powerful graphics processing units (GPUs) are in high demand for AI-based applications. The company's dominance in the AI chip market has other companies vying for a piece of the pie. Intel and Advanced Micro Devices are launching new chips they hope will compete with Nvidia, but it's easier said than done.

Nvidia is not just a GPU company. It also provides software, systems, and algorithms that create a platform of services for data scientists and AI researchers. This is why it earns sky-high margins, converting $0.49 of every dollar of revenue into a profit. Nvidia's free cash flow swelled to $27 billion last quarter on a trailing-12-month basis, which provides ample ammunition to invest in more innovation.

Some investors are skeptical how long Nvidia's reign will last. This is why the stock trades at a relatively low valuation. Its forward price-to-earnings (P/E) ratio of 38 is quite low for a company growing earnings at triple-digit rates.

But Nvidia's run is far from over. It's set to begin shipping the new H200 GPU later this year, which offers a leap in AI performance over the H100 that is fueling the company's growth right now. Plus, management is seeing growing interest from governments around the world that want to invest in AI to build large language models using their own languages. This could significantly extend Nvidia's growth runway.

Overall, Nvidia has everything you could want in an AI investment. It is enormously profitable, dominates the GPU market, and the stock is reasonably valued relative to its future prospects.

2. Alphabet (Google)

Shares of Alphabet are up 47% over the last 12 months, beating the return of the S&P 500 index. The company's investments in AI for Google Search and its digital ad business are great reasons to consider holding the stock.

Google is the leader in the digital ad market, but it is facing competition from Microsoft's Bing. Google Search has seen its market share decline in recent years, which could pressure growth in Alphabet's advertising revenue. This is why the stock is conservatively valued at a forward P/E of 22, which is lower than the average stock.

However, Alphabet has strengths in data and AI that are underestimated. With billions of users across YouTube and Google, the company has loads of user data to make its AI models smarter, and it's got the resources to keep investing.

It is investing billions in new servers and data centers while growing its free cash flow to $69 billion in 2023. Alphabet plans to significantly increase spending in 2024 to prepare for growth opportunities in offering more AI applications for individual users, advertisers, developers, governments, and cloud enterprise customers.

Speaking of the cloud, AI will have a major impact on the growth of Google Cloud -- one of the largest cloud service providers for enterprise. Alphabet's cloud revenue grew 26% year over year in the fourth quarter, and the segment is starting to turn a profit, which could benefit the stock.

Alphabet has tremendous financial fortitude, making it a relatively safe AI stock. It's a solid choice that can serve as a core holding in a well-diversified investment portfolio.