In the world of artificial intelligence (AI) investing, few stocks have been better recently than Nvidia (NVDA -0.42%) and Super Micro Computer (SMCI 3.48%). These two have had a phenomenal 2024 so far, with Super Micro Computer (often called Supermicro) up over 250% and Nvidia up by 80%.

But that performance becomes even more impressive if you backdate to the start of 2023, as Supermciro and Nvidia are up an astounding 1,160% and 520%, respectively. That level of performance might have investors wondering if there's room for more. If there is, the next obvious question is, "Which one should I buy?"

So, between the two, which is the better AI stock to buy today? Let's find out.

Nvidia and Supermicro work together

These two companies aren't competitors; they are complementary. Nvidia designs graphics processing units (GPUs) -- computing hardware that specializes in effectively processing intense calculations. These devices have been used for gaming graphics, engineering simulations, cryptocurrency mining, AI model training, and practically every other use that would require significant computing power to process.

Fortunately for Nvidia, most users (besides gamers) don't just have a single GPU. They buy hundreds or thousands of them and connect them to form supercomputers often housed in servers at a data center.

However, haphazardly linking them together will not result in an optimized computing experience, which is where Supermicro comes in.

Supermicro specializes in server design and has separated itself from competitors by offering highly customizable products that can be designed for workload type and size. Furthermore, Supermicro works closely with Nvidia to ensure its servers have been designed in an optimized manner so the end-user gets the most use out of their product.

This brings up the first difference: Supermicro has less differentiating technology. While Nvidia's GPUs are market-leading, Supermicro relies on industry knowledge and customization to separate itself from competitors. This can be a sustainable advantage, but it's less sustainable than having superior technology.

Another difference is that Supermicro is essentially an Nvidia reseller. It takes Nvidia's GPUs and other components to make its servers and then sells them to its clients. Because it cannot control the GPU pricing (the most significant cost of the server), Supermicro's margins are much slimmer than Nvidia's.

SMCI Gross Profit Margin Chart

SMCI Gross Profit Margin data by YCharts

Once again, this is just a differentiating factor. Plenty of businesses have succeeded with much lower margins.

But when it all adds up, my lean starts to go in Nvidia's direction due to its technological prowess and higher margins. Additionally, when I look at each stock's valuation, Nvidia also looks to have an advantage there.

Supermicro's stock has gotten very expensive

After these two stocks' incredible runs, valuing them can be difficult. Trailing metrics aren't useful, as they are still undergoing massive changes (both Supermicro and Nvidia grew revenue by over 100% in their latest results). As a result, I'll use a forward-facing metric like the forward price-to-earnings (P/E) ratio to value the companies.

Forward metrics have their issues, as they utilize analyst projections to value a company, which isn't an exact science. Still, it's arguably the best way to value these businesses, but Supermicro certainly comes with a price premium over Nvidia on this basis.

SMCI PE Ratio (Forward) Chart

SMCI PE Ratio (Forward) data by YCharts

This makes sense, as Supermicro's boom is just beginning, while Nvidia's is starting to mature (even though Wall Street analysts project nearly 100% revenue growth this year).

With Nvidia's stock trading at a lower level (and thus lower expectations to meet) than Supermicro's, I think there's no doubt that Nvidia is the superior AI stock. That's not to say that Supermicro is a bad stock, as it will likely continue to succeed due to its strong product offering and customization. However, the valuation bar is a bit higher for Supermicro, so I'm giving the nod to Nvidia.