Palantir Technologies (PLTR 3.73%) is a data analytics company specializing in processing, analyzing, and helping companies make sense of their data. It uses AI to help spot patterns and provide insights on complex datasets, and like many other big-name tech companies dealing with AI in some capacity, its stock price surged in 2023. Palantir stock finished the year up 167%.

A huge 2023 put Palantir on the radar of many prospective investors, but many are rightfully concerned about investing after such a significant surge. If you're wondering if Palantir is a buy now, it largely comes down to your time horizon.

Slowly becoming less reliant on government contracts

Palantir has historically leaned heavily on government contracts to pad its top line, and to a certain extent, it still does. Government revenue made up 55% of Palantir's total revenue in the third quarter, but its commercial segment was growing more quickly as it finished the quarter up 23% year over year.

Government contracts are good because they're usually reliable, multiyear agreements. However, investors should be pleased to see Palantir expanding and diversifying its revenue streams. Palantir finished the third quarter with 181 U.S. commercial customers, up 137% from the prior-year period.

Whether government or commercial, Palantir continues to add customers at a good pace, which should position it for sustained growth. Its trailing-12-month customer count grew 34% to 453. It might not seem like much, but Palantir's customers have big wallets. Its top 20 customers spent an average of $54 million over the past 12 months.

Palantir's profitability may be here for good

Palantir has consistently grown its revenue since it began trading publicly in 2020. That's expected for a growth stock, but with the third-quarter of 2023, the company achieved its fourth straight quarter of generally accepted accounting principles (GAAP) profitability after reporting net income of $72 million. Bottom-line growth has far outpaced the top line recently.

PLTR Net Income (Quarterly) Chart

Data by YCharts.

A single quarter of profitability could be an anomaly, but four consecutive quarters is a sign of a sustainable trend.

Palantir expects to finish 2023 with revenue of around $2.2 billion and GAAP profits for the year. That's momentum the company needs to continue its hot streak in the new year.

Palantir's stock is expensive by most standards

One of the biggest issues facing Palantir right now is its valuation. A huge 2023 surge is great for investors who owned the stock a year ago, but it can pose a challenge for prospective investors. Palantir's forward price-to-earnings ratio now sits around 57. That's noticeably more than many big tech powerhouses.

PLTR PE Ratio (Forward) Chart

Data by YCharts.

A high valuation doesn't mean Palantir is a bad investment; it just means incoming investors should approach the stock with caution and expectations of volatility. A good approach would be to dollar-cost average your way into a position.

Slowly but surely building a stake in Palantir can be a great strategy for investors who want to be a part of its growth while managing the risks that come along with it.