The victim is in a serious condition in hospital following the attack in Batley.
Police said it happened on Friday, August 3, after the driver picked up two male customers from Crown Cars depot on South Street in Dewsbury at around 1.40am.
He set off along Bradford Road towards Batley and was overtaken by a silver Ford Galaxy which pulled in front of him.
A police spokesperson said: "He was able to continue driving and pulled into the BP garage further along the main road. A second car, a silver Volkswagen Golf, and the Ford Galaxy both began to follow the driver and tried to ram the taxi.
"The victim and the two customers got out of the taxi at the garage and ran from the vehicle.
"The suspects then followed the victim and assaulted him. He sustained stab wounds to the leg, arm and head. He remains in hospital in a serious but stable condition.
"Police would like to trace the two males in the taxi at the time of the incident as detectives believe they may have information which is valuable to the investigation."