Earl Weaver, who will retire after 14 1/2 years as Orioles manager at the end of this season, has agreed to a two-year contract to remain with the club as a special consultant. Under terms of the contract, he can not manage another team during that period.

It apparently ends speculation George Steinbrenner might sign Weaver to manage the New York Yankees. "I'm going to fulfill this contract," Weaver said. "I hope it can go on for 10 or 15 years."

The Washington Post, in a report from the baseball meetings in San Diego 2 1/2 weeks ago, said that Weaver had agreed in principle to a contract to serve as a special consultant for next season and possibly for 1984 as well. That report said the contract would include a no-manage-elsewhere clause.

Asked about managing the Orioles again, Weaver said, "My feeling is the Orioles won't need another manager for 15 years." But he added, "I work for the organization and obey orders. I'd never let the club down."

Weaver will serve primarily as a major league scout, covering Florida-based clubs in the spring and selected teams during late August and September. He plans to live at his Miami home.

He said he'd like to give the minor leaguers talks on base running.

"I want to be around the club and go to games," he said.

Asked if there might not be problems with the new manager, Weaver said, "I don't see any. He can have me in or out . . . If the guy asks me in for a beer I'll accept. Yes, I'm not driving."