Palantir (PLTR 0.86%) has become one of the hottest stocks on Wall Street, with it up over 180% so far this year. After a run-up like that, many investors might wonder if it's time to sell after such incredible gains or if there is a reason to hold on and maybe buy more.

Let's look at Palantir's bear and bull case and see what investors should do with the stock.

What does Palantir do?

Palantir is a company that is highly focused on artificial intelligence (AI), which has been the primary culprit for its fantastic year. Palantir is a data processing platform at its core. It takes in any information a client feeds it and can give its users insights on what action they should take.

This product has applications from the military to insurance, so its potential use case is wide. Furthermore, Palantir recently introduced its Artificial Intelligence Platform (AIP), which utilizes a large language model (LLM) to create a chatbot where users can ask questions to further understand what they should do during a situation.

Palantir is one of the top companies in this space and was named a leader by Forrester for AI/machine learning platforms. But is the stock a buy?

The bull case: Palantir's finances are strong

As AI takes off, Palantir is likely to see more business inquiries. In fact, after Palantir announced AIP, CEO Alex Karp commented about AIP that "the demand ... is nothing I've ever seen in 20 years of being involved in Palantir." Strong demand for a newly launched product is a great sign and indicates Palantir could see some strong quarters ahead.

Currently, Palantir is growing its revenue at a solid rate, as it rose 18% in the first quarter to $525 million. It expects this growth range to continue, as it guided for $530 million in revenue during the second quarter -- a 12% increase. However, that guidance was given before AI became a hot-button topic, so investors shouldn't be surprised if Palantir beats those expectations when it reports earnings in early August.

It's also done something few young and growing software companies have done: achieve profitability. Palantir posted its first operating profit in Q1 and continues to post small (but profitable) earnings per share (EPS) numbers. This is critical, as it shows management can balance growth and profitability.

PLTR Operating Income (Quarterly) Chart.

PLTR Operating Income (Quarterly) data by YCharts.

With solid finances and a product offering in demand, Palantir's bull case is quite clear. Still, the bear case holds some weight.

The bear case: The stock is priced for perfection

Every stock comes with a price tag. Unfortunately for investors, Palantir's is quite expensive. With the stock trading just under 20 times sales, it has become quite expensive.

PLTR P/S Ratio Chart.

PLTR P/S Ratio data by YCharts.

Furthermore, the growth and profitability required for this valuation to make sense don't leave a lot of upside. If Palantir can grow its revenue at a 20% compound annual growth rate for five years and achieve a profit margin of 20%, that will give Palantir revenue of $4.94 billion and profits of $988 million in 2028.

At Palantir's current market cap of $37 billion, that would value the stock at 37 times earnings. That is about right for a mature software stock, but Palantir must put up phenomenal growth to achieve that point in five years.

Palantir could exceed that growth rate or achieve a higher profit margin, making my projections invalid. However, this exercise aims to demonstrate how Palantir is priced for perfection. For the investment to make money over the long term, Palantir must execute at a high level.

Because of that, I'm inclined to say investors should take some profits with Palantir but also continue holding on to the stock. Palantir could have some further upside, but with its current price point, it may take years for those profits to come to fruition.