Palantir (PLTR -0.23%) has been using artificial intelligence (AI) before it was "cool" to do so. Since its inception, Palantir has utilized AI to sort through piles of data and derive actionable insights from it. Because Palantir has been in the AI game for a long time, it's not just using AI as a buzzword to drum up customer interest; it's an integral part of its platform.

However, the stock has risen nearly 140% in 2023, leaving many investors (including myself) wondering if they've been left in the dust. So is it too late to buy Palantir stock? Or are there more gains ahead? Let's find out.

Palantir's new product is seeing high demand

Palantir's customer base is split into two halves: government and commercial. At first, Palantir was primarily focused on its government customers, but it has recently branched out to non-government clients. Still, government contracts are huge for Palantir, as 55% of fourth-quarter revenue came from government sources. Furthermore, government revenue grew 20% year over year, while commercial revenue rose 15%.

This outperformance is likely due to companies being more conservative in their expenses, as they have to worry about a potential economic downfall. Governments aren't known for the same level of spending control, so it's not surprising to see them spend more than their civilian counterparts.

However, one product Palantir is launching has the potential to kick-start even more growth from both customer bases.

Palantir's AIP (artificial intelligence platform) is the company's take on a large language model (LLM) offering. This technology is utilized in generative AI chatbots and can be seamlessly integrated into Palantir's other products. AIP can be asked questions about a current situation, and it will make recommendations based on available information.

CEO and founder Alex Karp commented about AIP that "the demand ... is nothing I've ever seen in 20 years of being involved in Palantir." That's very positive news for shareholders and could indicate further growth ahead. As such, investors must keep their ears open for Palantir's second-quarter earnings report in early August, since they will likely offer more updates on the demand for AIP.

Until then, we'll have to use Palantir's previous results, which were quite strong.

Its finances are improving, but the stock is rising even faster

Even though Palantir is a fairly young company, it's quickly turning the profitability corner. In Q4 2022, Palantir was profitable thanks to a one-time "other income" boost. However, Palantir posted its first operating profit of $4.1 million in the first quarter. While that's only a 1% margin, it shows Palantir's consistent execution in becoming more efficient.

PLTR Operating Margin (Quarterly) Chart.

PLTR Operating Margin (Quarterly) data by YCharts.

In Q2, these profits are projected to continue, and revenue is expected to increase by a 12% clip. While that marks a slowdown from Q1's 18% growth, don't be surprised if Palantir beats these projections, as it was only expected to grow by 13% in Q1 per management's guidance given during Q4.

As for Palantir stock, it trades at a much higher premium than it did just a few months ago.

PLTR PS Ratio Chart.

PLTR P/S Ratio data by YCharts.

Seventeen times sales is a high price to pay for a stock, especially if it's only growing around a mid-10% pace. Palantir will need to grow more quickly or become more profitable for this valuation to make sense. But I wouldn't be surprised if it achieves either of those marks.

In 2023 and 2024, Wall Street analysts expect revenue to grow by 16% and 19%, respectively. That's solid growth, but it would only drop Palantir's valuation to 13 times sales if you utilize 2024 estimates. Even if it could post a 20% profit margin, that would value the stock at over 60 times earnings -- an expensive price tag for its growth.

Because of that, I think investors may have missed the boat on Palantir with its current guidance. Palantir could easily come into the second quarter and drop a massive guidance boost that blows this analysis out of the water. Because of Alex Karp's comments about AIP demand, I wouldn't be surprised if this happened.

As a result, I think investors can still buy Palantir stock here, but they should only establish a small position (less than 1% of your portfolio). That way, you don't lose track of the stock, but you're not hurt if the investment doesn't work out how you want it to.