Palantir Technologies (PLTR 1.07%) is often ranked as one of the market's top artificial intelligence (AI) stocks. Since the beginning, its software has utilized AI to crunch lots of data and relay that information to its users on an easy-to-see dashboard allowing quick decision-making.

Since the beginning of May, Palantir's stock has been a rocket ship, rising 130% in just over a single quarter thanks to AI investment hype. But does Palantir's stock deserve those gains? Let's look at a few items and see if Palantir is one of the market's best AI stocks.

Its latest AI product has seen unprecedented demand

Open AI's ChatGPT, which runs on large language model (LLM) technology, started the AI investing arms race. Many consumers saw a digital assistant's usefulness in answering questions, and any company with AI aspirations quickly launched a product utilizing an LLM.

Palantir was no different, launching its Artificial Intelligence Platform (AIP) product. Last quarter, management noted how strong the demand was for AIP, and in the second quarter it delivered. Despite launching the product just 10 weeks ago, Palantir has signed over 100 clients to this product, and has interest from 300 more.

That's incredible growth from a single product line, but did it help translate to any financial gain? As It turns out, this product was necessary for Palantir just to post respectable Q2 revenue growth. Without the new launch of AIP, Palantir may have been in danger of growing in the single digits.

Inforgraphic with Palantir's income statement.

Image source: The Motley Fool.

In Q2, Palantir's revenue rose 13% year over year to $533 million, just $1 million above the high end of management's guidance. Government revenue outpaced commercial revenue, likely due to commercial clients' unwillingness to spend on expensive software packages when the economic outlook is uncertain. Looking ahead to the third quarter, Palantir expects revenue growth to accelerate to a more respectable 16% pace.

While Palantir's revenue growth isn't anything outstanding, its margin expansion has been terrific. Palantir's operating expenses only rose 1% in Q2, which is the main reason why Palantir has reached profitability. With disciplined spending, Palantir's management has shown it can balance expense growth in weaker times. This allowed Palantir to report its third consecutive quarter with $0.01 in earnings per share (EPS) based on generally accepted accounting principles (GAAP).

While $0.01 per share isn't a ton, it's a substantial improvement over last year's $0.09 per share loss. Every company's road to peak profitability starts somewhere, so investors shouldn't be too concerned about EPS only being $0.01.

All in all, this wasn't a bad quarter by any means for Palantir. But, if AI was truly a game changer, as everyone thought, Palantir should be posting much higher growth. As a result, I'm not willing to crown Palantir as the top AI stock in the market.

An expensive stock after its recent run-up

Even without this title, can investors buy Palantir's stock today for a reasonable price? Thanks to Palantir's stock price run-up, it's no longer valued as cheaply as it was when it entered 2023. With $2.05 billion in trailing-12-month revenue, Palantir is now valued at 18.6 times sales. That's not a cheap valuation, let alone for a company that's only growing revenue at a 13% pace.

However, many Wall Street analysts expect business to pick up next year, as the average of 16 projections predicts 19% revenue growth for Palantir in 2024. That would value the company at 14.5 times 2024 sales, which is still quite expensive.

That's an expensive price tag because if Palantir could snap its fingers and achieve the same profitability levels as a mature software company like Adobe (historically around 30%), it would be valued at 48 times 2024 earnings. Once again, that's with Adobe's margins. Because Palantir's profit margin was only 5.3% in Q2, it has a long way to go.

Furthermore, management is about to do something I believe is foolish with its cash horde: repurchase stock. The stock is very expensive, so share repurchases don't seem like a great use of capital. Considering how young Palantir is, this is a surprising decision and makes me question management's capital allocation strategy.

So should investors avoid Palantir's stock? I don't think so. If you're a long-term investor -- sticking around for at least three to five years -- it could be a fantastic investment if Palantir can maintain its mid- to high-teens growth rate. But anyone owning the stock will have to display patience as the market will ebb and flow with its opinion on Palantir's stock. Initiating a small position to track it at these levels is OK, but going all in on Palantir isn't wise until the business shows stronger growth.