Palantir Technologies (PLTR 3.73%) is one of the most popular artificial intelligence (AI) stocks, and it's not hard to understand why: It has been deploying AI for much longer than its competition.

With Palantir's experience, it's a top pick in this space, but the popularity also comes with a premium price tag. So, has the stock become too expensive right now?

Commercial revenue is a vital part of the Palantir growth thesis

Palantir's AI tools started out solely focused on government use. Its software takes in large data streams, interprets them using AI, and then gives insights on what action users should take.

This was deployed by various intelligence agencies, the Defense Department, and other government offices, but Palantir eventually realized that this software could also be deployed in the civilian world.

Still, government contracts are the largest part of Palantir's business: 55% of revenue came from this sector in the latest quarter.

But commercial revenue is growing much faster, up 23% in the third quarter versus a 12% gain in government revenue. In the U.S., commercial revenue increased even quicker, rising 33%.

These are great signs for Palantir bulls, as the growth rates are healthy and increasing over the commercial levels seen in the second quarter.

But all of this comes at a price. The stock has risen around 200% in 2023, while its financials haven't increased at nearly that pace. This mechanism, known as multiple expansion, occurs when the market is willing to pay more for a stock than it previously had.

With this increase, is Palantir too expensive? Let's compare it to another popular software company, Adobe, to see.

Palantir's margins are improving, but are nowhere near Adobe's

Adobe is what many software companies aspire to be when fully mature. Its 29% profit margin is among the best in the software industry and dwarfs Palantir's 13%, but what if Palantir's levels were equal (which may happen when Palantir has reached maximum operating efficiency)?

If it could duplicate Adobe's profit margins, it would have generated profits of $615 million over the past 12 months. With Palantir's $42 billion market cap, that would value the stock at 68 times earnings. For reference, Adobe trades for 56 times earnings right now and has averaged 50 times since the start of 2016.

So, with Palantir growing much faster than Adobe, it probably deserves the slight premium. But remember: That's if Palantir can achieve the same profitability level as Adobe. Management has worked toward that goal by decreasing operating expenses, which has boosted the company's margins.

PLTR Total Operating Expenses (Quarterly) Chart

PLTR total operating expenses (quarterly); data by YCharts.

So the question remains: Is Palantir too expensive to buy? My answer: It depends.

The price is expensive; there's no doubt about that. As a result, devoting a large portion of your portfolio to Palantir is a very risky proposition. However, if you want to take a small position to keep track of the company and cash in on the rise of AI, then it could be the stock for you.

Investors must keep in mind that if the market decides Palantir is no longer worth its premium, the stock could fall even if the company is doing just fine. If you can accept that risk, then Palantir looks like it could be a great investment if you hold it over the next three to five years.

But that's a big risk, and one that many investors have gotten caught by during multiple tech bubbles.