The Philadelphia Phillies are preparing a substantial offer to their soon-to-be-free-agent left-hander Cole Hamels in an attempt to determine whether they can sign him to an extension in the next two weeks, sources told ESPN.com on Thursday.

However, the Phillies are aware that in order to retain the winningest pitcher they have developed in the past 40 years, it could require one of the largest contracts in team history.

Both Phillies general manager Ruben Amaro Jr. and Hamels' agent, John Boggs, declined to comment on any aspect of the negotiations.

The market for Hamels has been shaped in the past few months by the five-year, $112.5 million extension signed by San Francisco right-hander Matt Cain in April, a deal that actually guaranteed him six years and $127.5 million when his salary for 2012 was factored in.

The Phillies also influenced that market with the five-year, $120 million deal they agreed to with Cliff Lee in December 2010, a contract that established a then-record average annual value for a pitcher of $24 million per season.

Although the Phillies' payroll is approaching the $178 million luxury-tax threshold (and actually may already have exceeded it), the club believes it can find a way to sign Hamels and stay under the threshold in 2013 and beyond, a source said.

However, the Phillies never have signed a pitcher to a contract that included more than the five guaranteed years they gave Lee. And sources said they remain wary of guaranteeing six years or more, but have had numerous internal discussions about whether to break that precedent in Hamels' case.