The 27-year-old worked with the new Millers manager while on loan at Hibernian last season, where he scored nine goals in 19 starts, including a double in the Scottish Cup final.
He leaves Celtic despite having a year left to run on his contract after falling out of favour under former boss Ronny Deila. New manager Brendan Rodgers has opted to release him.
A statement from Celtic said: “Celtic Football Club today confirmed that Anthony Stokes is leaving the club.
“Anthony signed for Celtic in 2010, and made 192 appearances for the club, scoring 77 goals. He spent last season on loan to Hibernian FC.
“Everyone at Celtic would sincerely like to wish Anthony the very best of success for the future.
Stubbs said: “I wouldn’t rule out an interest in Anthony Stokes. But there will be a number of clubs interested in him, particularly if it’s a free transfer.”