Palantir Technologies (PLTR 3.73%), which is deeply involved with analytics and artificial intelligence (AI), has been growing both its commercial and government operations over the years.

However, some investors are concerned that perhaps it is too dependent on the government for its growth. A change in administration could bring different policies, and that could impact contract renewals. At the same time, however, government customers can be a great source of consistent and recurring revenue.

Below, I'll look at how much of Palantir's revenue has come from government versus commercial customers and what's been driving its growth.

The revenue mix has been shifting -- slightly

In Palantir's most recent quarterly results, the company's government revenue totaled a little under $308 million, which was 23% more than the $251 million in revenue its commercial clients brought in.

Palantir revenue by segment.

Image source: Company filings.

Two years ago, the revenue was slightly more tilted, with government revenue of $218 million being 25% higher than the $174 million the company reported on the commercial side. While technically, Palantir has become less dependent on government revenue since then, there hasn't been a huge change.

Why the mix could change in the future

Now that AI has become more mainstream and businesses are looking to do more with data, Palantir has been experiencing a significant uptick in demand. And last quarter, it experienced a notable jump in commercial revenue.

Palantir's quarter-over-quarter growth rate by segment.

Image source: Company filings. Chart by author.

There has been a fair bit of volatility in quarter-over-quarter revenue growth. But consider that ChatGPT launched in November 2022. That's when the AI hype really started to take off. If you just look at the last three quarters, since the start of 2023, it's clear that the commercial business has been doing much better, with at least 8% quarter-over-quarter revenue growth in two of the past three quarters.

With the company recently launching AI bootcamps in a bid to help businesses find use cases for AI by trying out Palantir's software, this is a trend that could very well continue into 2024 and beyond.

While the company is still generating most of its revenue from government contracts, that may not be the case in the long run, which is why I don't think Palantir's exposure to government should be a big concern for investors.

Should you invest in Palantir's stock?

Palantir has been a hot stock to own this year, and its shares are up by 175%. The one problem is that the stock isn't cheap, trading at 19 times revenue and 12 times its book value. Even based on future earnings estimates, it's at a multiple of more than 60 times profitability.

Granted, the company has only recently become profitable, and its earnings should improve, but those are high premiums investors are paying for the business. And that means a lot of future growth is already priced into the stock.

As long as you're willing to buy and hold shares of Palantir for multiple years, the AI stock can still make for a good investment in the long run. But investors should temper their expectations as 2024 likely won't be a repeat performance of 2023.