Congressional conferees have agreed on a formula to finance currently unfunded pensions of retired District employes that is acceptable to the Carter administration.

A compromise, worked out yesterday, calls for the federal government to pay for 80 percent of the costs of pensions of retired firefighters, police officers, teachers and judges. The package would cost the government $1.3 billion over the next 25 years.

Last year, Congress approved a proposal that would have cost $1.6 billion, but President Carter vetoed it as too costly. A representative of the Office of Management and Budget said this year's legislation is acceptable to the White House.

The agreement "removes a cloud over D.C.'s financial future," according to an aide to Sen. Thomas F. Eagleton (D-Mo.), one of the conferees.

The Senate had approved a bill that would have set the federal participation at 100 percent of the costs, while the House version set that amount at 75 percent.

"All the conferees would have preferred 100 percent," the Eagleton aide said, "but we cut back to get OMB approval."

While expressing the belief that the bill should have gone further in acknowledging federal responsibility for the "fiscal crisis" facing city pension programs, Mayor Marion Barry pronounced it far better than no bill at all, and said he would urge its approval.

District officials argued that the federal government should pay all the costs of pensions earned by city employes prior to 1975, because those benefits were approved by Congress before the city was granted home rule. The generous retirement plans were established without a fund to pay for them, and benefits have been paid out of annyal D.C. operating budgets.

The $1.3 billion federal contribution, from which a first installment would be paid in a supplementary appropriation later in this fiscal year, is designed to help the city government build up a fund from which interest payments can be used to help offset existing retirement obligations that have become a massive unfunded liability.

Although there is no prohibition against using the federal money to help offset retirement costs of current and future employes, the dollar amount was based only on a federal obligation incurred through 1975.

The legislation also would abolish what was cited as the single largest abuse of the old retirement system. This is the so-called aggravation clause by which, in the past, police and fire employees boosted their pension benefits by claiming that off-duty injuries had been aggravated by on-duty performance.

The conferees also adopted a Senate stipulation that sets tough penalties if the District continues to be overly generous in granting retirements on disability.

That provision was aimed at answering the criticism included in last November's veto message, in which Carter said he would support pension legislation "providing that provisions are included that fully remedy the problem of retirement abuses."

At a hearing before the House District Committee earlier this year, Barry testified that "impressive gains" already have been made in reducing abuses.

In 1969, for example, the mayor said, 99 percent of all retiring public safety employes were granted disability pensions. Last year, only 44 percent of new retirements were attributed to disability, a showing better than safety forces in New York, Chicago, Detroit, Baltimore, Boston and New Orleans, Barry said.

Attending the conference session in addition to Eagleton, who is chairman of the Senate government operations subcommittee of the District, were Rep. Ronald V. Dellums (D-Cal.), chairman of the House District Committee, Sen. Charles McC. Mathias (R-Md.) and Del. Walter E. Fauntroy (D-D.C.).

The action requires pro-forma ratification by the Senate and the House, which is likely to come next week.