If you had to choose a stock market winner this year, it'd be hard to overlook Nvidia (NVDA 0.14%). The company's shares have skyrocketed roughly 210% since Jan. 1 as the company became a key player in artificial intelligence (AI). Nvidia is one of the biggest producers of graphics processing units (GPUs), which are crucial to developing AI software. The company's dominance in GPUs has allowed it to profit substantially from the boom in AI.

Demand for these chips is rising fast, strengthening Nvidia's long-term outlook. However, a recent bull run has made its stock more expensive than many of its peers. Countless companies have expanding positions in AI, suggesting it might be worth looking elsewhere to back the high-growth sector.

So, before going all in on Nvidia's stock, here is one green flag and one red flag for the company in 2023.

Green flag: Nvidia's winning quarter

Nvidia is thriving as the favored option for AI-minded companies seeking chips. In the second quarter of its fiscal 2024 (July 2023), Nvidia's revenue rose 101% year over year as it hit $13.5 billion. The rise is primarily owed to a 171% jump in data center revenue as more businesses turn to Nvidia for their AI needs. What's more, operating income soared 487% year over year, a solid recovery from the economic downturn of 2022. 

The semiconductor company expects a bigger boost to revenue in its current quarter as supply strains are resolving more quickly than expected. Financially, Nvidia is on a solid growth path. However, its stock has actually declined roughly 4% since the company posted its quarterly results. Excitement for the company's AI potential seems to have peaked for now.

As a result, an investment in Nvidia should be held for the very long term. The company has massive potential in the next five to 10 years as its command of the AI chip market strengthens. Meanwhile, it is investing in up-and-coming tech regions such as India. However, much of its short-term growth will already be priced into its shares, so prospective investors will need to be patient to see significant gains.

Red flag: There are cheaper ways to invest in AI

While Nvidia's monster rally this year has been excellent for current investors, it has also raised the price of entry and sunk the value of its stock. The chart below shows how Nvidia's price-to-earnings ratio (P/E) is among the highest in tech and companies active in AI. 

AMZN PE Ratio Chart

Data by YCharts

This is a useful metric when determining value, with an optimal P/E often 20 or below. As a result, all of the companies in the chart are on the pricier side. However, companies like Microsoft, Apple, and Alphabet offer more value. Even chipmaker Advanced Micro Devices has a P/E of 55, about half of Nvidia's.

So, if you're interested in investing in AI, it's wise to consider other companies right now while keeping Nvidia on your radar to strike when the time is right. One of the best alternatives among the companies above is Microsoft. The Windows company holds exclusive licenses to multiple AI models from ChatGPT developer OpenAI. Meanwhile, it is the world's second-largest cloud company and has immense dominance in productivity software. Both of these are high-growth AI markets that have massive potential over the long term and could provide stockholders with consistent gains.

Nvidia shares have climbed over 1,000% in the last five years. In that time, annual revenue has soared 130%, with operating income up 47%. There's no telling how high that growth could be in another five years alongside the power of AI. It's probably best to invest in a company like Microsoft, but if you're dead set on Nvidia, just be prepared to hold for the very long term.