Artificial intelligence (AI) has become a hot topic in tech after the launch of OpenAI's ChatGPT software in November 2022. The platform's advanced ability to produce human-like dialogue based on prompts stunned the world and triggered an AI race among the biggest names in tech.

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 a result, it's no surprise many companies are venturing into the hypergrowth industry.

Amazon (AMZN 0.78%) and Nvidia (NVDA 6.98%) have each made promising strides in AI, strengthening their positions in the market's future. These companies' stocks are compelling buys as AI advances, with now an excellent time to consider investing.

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

1. Amazon 

Amazon has used artificial intelligence to enhance its e-commerce business for years, using it for functions like consumer product recommendations, forecasting when demand for specific items will increase, and tracking deliveries. However, the company's cloud computing service, Amazon Web Services (AWS), has the potential to boost the mass adoption of AI significantly.

Cloud platforms have become closely aligned with AI development, with many businesses able to elevate their productivity with the technology. In fact, Microsoft's Azure has already made ChatGPT available on its cloud platform, with more OpenAI services likely to come in the future.

As of the third quarter of 2022, Amazon held a leading 34% market share in cloud computing, with the second-largest market share being Microsoft at 21%. Amazon's solid lead in the industry allows it to further push its AI services to consumers.

Additionally, AWS already has a wide variety of AI-driven offerings, including image and video analysis, data extraction, chatbot-building tools, speech recognition, and many more.

Amazon reported a 28.8% year-over-year rise in revenue of $80.1 billion in fiscal 2022 from AWS. Meanwhile, the segment was responsible for 100% of the company's revenue for the year, with the platform's earnings coming in at $22.8 billion after rising 23%. The platform is already booming, but more adoption of AI services could see the segment soar.

So if you're looking for a way to invest in artificial intelligence, Amazon's stock is an attractive option.

2. Nvidia

Nvidia's stock has shot up 60% year to date based on its prospects in artificial intelligence, and for good reason. The hardware that the company develops, such as its graphics processing unit (GPUs), has the power necessary to run and develop AI software.

For instance, the company recently partnered with Microsoft's Azure to build a massive AI supercomputer. The collaboration will combine Azure's infrastructure with Nvidia's GPUs to create a system aimed at helping "enterprises train, deploy and scale AI."

Nvidia's stock has skyrocketed over the last five years, rising 282% and increasing over 7,000% in the last decade. The immense growth has come as the company has profited from a rise in consumers building custom PCs and using Nvidia's GPUs to power activities like gaming and video editing. The consumer GPU market suffered in 2022 due to economic headwinds, with worldwide sales for the devices sinking 42%. However, artificial intelligence gives Nvidia another lucrative opportunity to sell its hardware.

According to research from TrendForce, demand for GPUs from ChatGPT alone will reach 30,000 chips after hitting 20,000 in 2020. Considering multiple other companies are currently developing competing software, Nvidia could profit substantially from boosted demand.

Amazon and Nvidia each have immense potential in the future of AI, with one specializing in software and the other in hardware. Determining which has the biggest financial potential in the industry is complex. However, for now, Nvidia is the better AI stock. While Amazon's leading market share in cloud computing is attractive, increasing competition could hinder its growth in the industry. Meanwhile, Nvidia's ability to provide its GPUs to the whole market makes its stock a screaming buy as AI develops.