Palantir and Nvidia have been rewarding investments since the artificial intelligence trade exploded in late 2022.