The San Francisco Giants have agreed to a two-year, $24 million contract with Jake Peavy, according to a source.

The deal will pay Peavy base salaries of $7 million in 2015 and $13 million in 2016, the source said. It includes a $4 million signing bonus, a full no-trade clause and an awards package.

Peavy went 6-4 with a 2.17 ERA with the Giants in the second half of the 2014 season.