Shia LaBeouf loudly claimed an L.A. bartender "f**ked up" by threatening him over french fries -- but now the bartender's striking back ... with a lawsuit.

You'll recall, Shia exploded in a rage last month, screaming at staffers in Pinz Bowling Alley and Jerry's Famous Deli. It was never very clear why he flipped out, but it was crystal clear that he singled out David Bernstein ... the bartender at Jerry's.

In a lawsuit, Bernstein says Shia lost it because he'd been cut off from booze. He says the actor was "significantly under the influence" ... and pounded on the bar with his fist at the news he would not be served.

In docs, Bernstein says he grabbed a Grey Goose vodka bottle because he was worried Shia was about to attack. The bottle is clearly cocked on his shoulder in videos of the incident. He adds ... Shia calling him a "f**king racist bitch" was an attempt to "incite a predominantly African-American crowd.". 

Bernstein insists in his suit ... all his customers love him, including the black ones.

He's suing Shia for defamation and assault, and seeking damages of at least $5 million.