After start-up OpenAI stunned the tech world in November 2022 with the launch of ChatGPT, an advanced chatbot capable of producing human-like prose based on prompts, many companies pivoted their businesses to make some artificial intelligence (AI) connection. According to Grand View Research, the AI market was valued at $136.55 billion in 2022 and is projected to expand at a compound annual growth rate of 37.3% through 2030 as the technology pushes numerous industries forward, such as healthcare, education, consumer tech, and more.

As a result, Microsoft's $1 billion investment in OpenAI in 2019 looks like the foresight of the century, with the start-up's technology already being integrated into Microsoft's cloud platform Azure. In fact, recent reports say Microsoft is now considering a further investment of $10 billion into OpenAI to grow its stake in the lucrative market.

While Microsoft looks poised to be a major player in the future of AI, two other companies will likely help boost the industry over time: Nvidia (NVDA 3.71%) and Alphabet (GOOG -1.96%) (GOOGL -1.97%). These companies have a lot to gain from the swiftly expanding industry, making their stocks compelling buys.

So is Nvidia or Alphabet the better AI stock? Let's assess. 

Nvidia: Powering the future of AI

As a leader in graphics processing units (GPUs), Nvidia is home to devices with the power to run and develop AI software. As a result, the company likely has a crucial role to play in the industry's growth. 

Nvidia took a positive step in AI in November 2022, partnering with Microsoft's Azure to build a massive cloud AI computer. According to a press release from Nvidia, the collaboration will combine Azure with Nvidia's GPUs to "help enterprises train, deploy, and scale AI, including large, state-of-the-art models." Considering Microsoft's substantial role in AI thus far, Nvidia's partnership with the company could prove immensely lucrative over the long term.

In addition to a promising collaboration, Nvidia is taking independent steps in artificial intelligence by offering creators and developers a variety of resources on its site to use its products to develop AI software for a variety of industries, such as art, audio transcription, data science, and more. 

Nvidia's stock price has skyrocketed 52% since Jan. 1, as Wall Street has grown bullish over the tech giant's prospects in AI. While many companies' future position in AI feels more hypothetical, Nvidia's tangible role in the industry, thanks to its powerful GPUs, makes its stock a reliable and compelling investment in the budding market.

Alphabet: The market share to dominate AI

Alphabet posted dismal fourth-quarter 2022 results on Feb. 2, with revenue of $76.05 billion growing 1% year over year and missing analysts' expectations by $440 million. The company suffered throughout 2022, as macroeconomic headwinds triggered significant declines in ad spending. However, Alphabet recently announced a stronger focus on AI going forward, which could prove to be a lucrative pivot over the long term. 

The company's priority on AI comes as the launch of ChatGPT has posed a substantial threat to Alphabet's search engine Google. While Google provides links to users' questions, ChatGPT is arguably more helpful by giving fully formed answers. Additionally, the software has only grown more threatening after recently being integrated into Microsoft's already-established search engine, Bing. 

In one of its first moves to combat Microsoft, Bloomberg reported on Feb. 3 that Alphabet had invested close to $400 million in OpenAI rival Anthropic. While Alphabet is right to respond to recent AI developments with its own venture into the industry, the company's majority market share in search engines will likely be hard to beat, as AI upgrades to Google could make it an unconquerable force.

Alphabet held an 84% market share in search engines as of December 2022, while Bing's was at 8.9%. If the Google company can move quickly, it shouldn't have too much trouble keeping its dominance in the market.

In addition to its dominance over search engines, Alphabet's other potent brands, such as Android, YouTube, Waze, Fitbit, and the many services under Google, could also be elevated by AI and boost its position in the high-growth market. 

So which is the better AI buy?

Comparing Alphabet's and Nvidia's stocks is tricky, as one is currently a better bargain, while the other has a stronger position in AI. Regarding the companies' forward price-to-earnings ratios, Alphabet's 19, compared to Nvidia's 51.7, shows that Alphabet's stock is a better value. However, Nvidia's GPUs and a partnership with Microsoft Azure give it a stronger lead in the AI race.

As a result, Nvidia is currently the better AI stock. However, if you want more bang for your buck and have faith in Alphabet's future in the industry, go with the Google giant.