If you're interested in the stock market, chances are you've heard about the current boom in artificial intelligence (AI). Many companies active in the high-growth sector have enjoyed monster rallies this year as the AI market is projected to expand at a compound annual rate of 37% through 2030. As a result, it's not a bad idea to add an AI stock to your list of holdings. And with so many companies entering the market, there are plenty to choose from. 

As two of the biggest names in tech, Apple (AAPL -0.69%) and Amazon (AMZN -1.07%) are two attractive options with increasing potential in AI. These companies are gradually expanding their positions in the industry and could profit significantly from its development. So let's assess whether Apple or Amazon is the better AI stock.

Apple: Could soon rival ChatGPT

Apple has largely avoided the AI buzz this year. However, a recent Bloomberg report revealed the company has been quietly developing a rival to OpenAI's ChatGPT using a homegrown framework for building language models. Engineers have reportedly nicknamed it Apple GPT, with the company working on various AI tools to eventually release to consumers.

The tech giant has gradually expanded its AI offerings this year, focusing on software upgrades in its product lineup. At its Worldwide Developer Conference in June, Apple announced a revamp of the iPhone's autocorrect that uses an AI language model to learn a user's texting style. Meanwhile, Air Pod Pros will offer an AI-enabled feature that automatically turns off noise cancellation when wearers begin a conversation. 

Apple holds a leading market share in smartphones, tablets, headphones, and smartwatches. Its substantial dominance in tech could attract millions of users to its AI services in the future, making its stock a compelling way to back the quickly growing sector.

Amazon: Expanding in AI software and hardware

Amazon seemingly started the year at a disadvantage, with its biggest competitor, Microsoft, getting a head start in AI cloud services as the biggest investor of OpenAI. However, the retail giant has spent the last six months making significant strides in the market.

In June, Amazon added two new AI tools to its cloud platform, Amazon Web Services (AWS). The first is Bedrock, which allows clients to use language models to build custom chatbots and image-generation services. The second is CodeWhisperer, a code generator that makes software development more efficient.

Moreover, Amazon has become one of the only cloud companies to expand into the hardware side of AI by developing its own chips. The e-commerce company will soon take on the likes of Nvidia by launching two chips, Inferentia and Trainium, which CEO Andy Jassy says will have "much better price-performance than you'll find anywhere else."

As the home of the world's largest cloud platform with AWS, Amazon could gain an edge against competitors like Microsoft and Alphabet. Meanwhile, expanding positions in both AI software and hardware only improves its potential as its dominance could spread across multiple areas of the industry. 

Is Apple or Amazon the better AI stock?

Apple and Amazon have developing positions in different areas of artificial intelligence, with one focused on upgrading its product lineup and the other on attracting cloud clients. However, both companies are steadily developing their generative AI offerings, which could bring them into direct competition. 

As a result, the better option lies in which is the more reliable stock. Amazon likely faces an uphill battle with steep competitors in the cloud and chip markets, having to contend with tech giants like Microsoft and Nvidia. However, consumers have already proven their overwhelming preference for Apple products over competing devices. Consequently, Apple could have an easier time getting its AI services into the hands of the public than most companies.

Additionally, Apple's stock has risen 301% over the last five years, while Amazon's has increased by 43%. The significant difference further solidifies Apple as the more reliable option and the better artificial intelligence stock.