Many artificial intelligence (AI) stocks have been soaring in value over the past year and their high valuations mean there may not be a whole lot of upside left. While they may still generate good returns, at high prices, investors are effectively paying for a lot of future growth. And that can make many AI stocks risky buys because if their growth doesn't pan out, their valuations could crumble.

But according to Wall Street's price targets, two stocks that still have plenty of upside left in the near term are BigBear.ai (BBAI -2.78%) and Baidu (BIDU 5.62%). Are these AI stocks as attractive as they appear to be, and are they worth investing in today? Let's take a closer look.

BigBear.ai has a small pool of customers

According to Wall Street, BigBear.ai could jump by more than 50% over the next year or so as multiple analysts have set price targets of $3 and higher for the stock.

BigBear.ai participates in a competitive area of AI by assisting companies with complex business decisions. The company says its customers use its "predictive analytics capabilities in highly complex, distributed, mission-based operating environments." One problem with this is that is a bit vague and many companies involved with AI claim to help improve decision making; it can be difficult to determine how good the business is versus other companies offering similar products and services.

Another potential cause for concern is that BigBear's revenue is highly dependent on four unnamed customers. In 2023, those customers accounted for 58% of BigBear's total revenue, with one customer accounting for as much as 21% of its top line. That's a lot of exposure to a few customers, which means that the company's top-line growth is going to depend a lot on how strong and secure those customers are.

BigBear.ai reported $155.2 million in revenue last year, which was flat from the previous year. And with its gross margin coming in at only $40.6 million, the company's selling, general, and administrative expenses, which totaled $71.1 million, easily wiped that out, putting the company into the red.

BigBear's financials aren't great and the business hasn't exactly been showing any exciting growth. While it's in the AI business, this is an underwhelming AI stock to own. It's down 20% in the past 12 months and I wouldn't be surprised to see price targets get adjusted downward for the stock; it's simply not that attractive of an investment.

There are some risks with Baidu

Chinese tech company Baidu also struggled over the past 12 months with its share price falling by 28% during that time frame. But with a consensus analyst price target of nearly $177, the stock has a projected upside of more than 60% right now.

In addition to being a search engine giant in China, Baidu also provides a range of AI-related services, including AI chips, deep learning framework, and other AI capabilities. Baidu claims to be "one of the very few companies in the world that offers a full AI stack." And while you may have heard of ChatGPT, Bard, and Gemini, one chatbot you might be unfamiliar with is Baidu's Ernie. That chatbot was launched last year and offers similar capabilities, being able to answer questions and write detailed analysis and responses.

Last year, Baidu reported revenue growth of 9%, with its top line rising to around $19 billion. Operating income of $3.1 billion was also up by 37% year over year. Trading at just 10 times its estimated future profits (based on analyst expectations), it's a potentially cheap stock to own.

Unlike BigBear.ai, Baidu looks to be a solid AI play. With a dominant presence in China and an increasing number of AI-related products and services, Baidu can be an underrated stock to buy today. There are, however, concerns that the Chinese government might have too significant of an impact on the business and its long-term growth prospects -- there have even been reports suggesting that Ernie may be involved with military research, although the company rejects that claim. If you're OK with some risk, Baidu could make for an intriguing AI investment given its low valuation, especially if you also want to diversify outside of the U.S.