Flo Rida must have some really good lawyers...the rapper struck a deal with prosecutors that will keep him out of jail.

Flo was busted in Miami Beach back in June for a DUI in his Bugatti. Cops said his blood alcohol level was .185 - more than twice the legal limit.

But an attorney for Rida saved him from doing time, and instead got the rapper a thing called "Back on Track", which entails substance abuse classes, counseling, community service, and drug testing.

If Flo completes all the requirements, prosecutors will knock the charge down to reckless driving.

Source: tmz.com