The Cubs, who also agreed to a one-year deal with right-hander Kohl Stewart this week, are looking to bolster a pitching staff that lost Jon Lester, Yu Darvish, Tyler Chatwood and Jose Quintana in free agency this offseason.
Williams, 28, struggled in the pandemic-shortened season last year, going 2-8 with a 6.18 ERA while giving up the most home runs (15) in the majors. He fared little better in an injury-plagued 2019 campaign, where he went 7-9 with a 5.38 ERA in 26 starts.
The Cubs hope Williams will be able to recapture the form he showed in 2018. The right-hander finished 14-10 with a 3.11 ERA but had a sterling 1.38 ERA after the All-Star break.
Williams, who spent the entirety of his five years in the majors with Pittsburgh, is 31-37 with a 4.43 ERA for his career.