The one-time Liverpool man is understood to have arrived in England on Thursday morning to undergo a medical and put the finishing touches to a move.
It is believed that the 31-year-old will pen a two-year contract with the Hammers.
Diarra was expected to be on the move this summer after struggling to settle at Marseille.
He only joined the club in 2011, but failed to produce his best at Stade Velodrome.
He did make France's Euro 2012 squad, and started their first game against England, but much of his focus has been on the future.
Diarra will be hoping that a return to England will help to bring the best out of him and allow him to prove to those at Anfield that they were wrong to let him go without making a senior appearance.
His career took off after leaving Anfield, with spells at Lens, Lyon and Bordeaux seeing him pick up two French titles and two Coupe de la Ligue successes.