Postal Service and union negotiators agreed early yesterday on a tentative three-year contract that defused strike threats and only slightly exceeds the Carter administration's anti-inflation wage goal.

Under the contract, postal workers would get average annual increases of 6.5 percent in wages and cost-of-living adjustments, more than the administration's 5.5 percent target but less that the projected 7 percent inflation rate for 1978.

The total three-year increase of 19.5 percent was also less that the 23.5 percent the postal unions won in 1975.

The agreement, which is subject to ratification by more that 550,000 postal workers over the next two to three weeks, came at 4 a.m. after nearly 15 hours of nonstop bargaining that left some union leaders with mixed feelings.

"I'm not too happy with it, but it's the best we could do," said Emmet Andrews, president of the 300,000 member American Postal Workers Union, the largest of the four postal unions.

Rather than making major money gains, the unions' chief achievement was to hold onto what they already had.The Postal Service had bargained aggresssively for so-called "take-backs" of concessions made in previous contracts.

It was an "historic document because the unions have had to show that employers cannot take away items won in previous contracts," said James LaPenta, a leader of the mail-handlers division of the Laborers International.

The unions salvaged a "no-layoffs" guarantee that the Postal Service wanted to scrap, preserved cost-of-living protections and prevented imposition of new ceilings on insurance compensation.

But in exchange for this, the Postal Service came away with a money package much closer to what the administration wanted than what the unions sought (14 percent a year).

The 19.5 percent increase would yield $1,609 a year on top of current average pay of $15,877. The flat wage increases, not including cost-of-living adjustments, amount to 2 percent the first year, 3 percent the second year and 5 percent the third year.

While they were not uniformly enthusiastic about the settlement, top union leaders indicated they expected it to be ratified.

Some local union officials, expecially from New York, said they would campaign for rejection of the contract, and at one point Moe Biller, the New York APWU leader, said his people were vowing to strike.

But most postal facilities were reported to be operating normally yesterday morning, including those in New York and other centers of union militancy. (SECTION) TThe major exception was a huge bulk and foreign mail handling center in Jersey City, N.J., where 80 to 90 percent of the morning shift of 1,600 failed to report for work. About 100 workers picketed entrances to the building, charging the contract was a "sellout." By the mid-afternoon shift, about 50 percent had reported for work, officials said.

The APWU executive board rejected a strike demand by angry dissidents, 35 to 10, and later voted 30 to 15 to recommend approval of the contract. The Letter Carriers board also recommended approval, and the Mail-handlers board is expected to act today.

At a predawn briefing on terms of the contract, Postmaster General William F. Bolger, who entered the talks in their final hours to help resolve money issues, told reporters he thought the pay package "fits in very well" with the Carter administration's anti-inflation guidelines.

These guidelines seek contract settlements significantly lower that previous agreements and set 5.5 percent a year as the goal for government workers, including postal employes, to show the administration means business about fighting inflation.

Bolger said it also fit in with his plans not to raise postal rates for the next 3 1/2 to 3 years. The Postal Service raised rates in May, pushing the cost of a stamp from 13 to 15 cents.

The postal settlement is considerably below a proposed pay increase of up to 35 percent over three years that was negotiated recently by four rail-road unions and is currently before seven others. The administration had hoped to keep this agreement to 30 percent or less. A previous pay settlement for coal miners totaled 37 percent.

Administration inflation fighters, who some time ago made the postal contract a target of their anti-inflation campaign, had little to say yesterday. Some said it would be inappropriate and risky to comment before the ratification votes. One official said there was tacit agreement to avoid the confusion of conflicting statements that greeted the coal settlement.

Presidential press secretary Jody Powell said the contract was being reviewed for inflation impact and added, "I don't think it's productive for the administration to engage in public analysis of it."

The governmnet and major mail users had contingency plans ready in case of walkouts, which are illegal but have happened before. The 1975 contract was negotiated without a strike, but 200,000 workers walked out in 1970.

The Postal Service, an independent agency set up Congress to run along businesslike lines negotiated simultaneously with the APWU, the Letter Carriers and the Mailhandlers. It settled separately with the rural letter carriers union.

The no-layoffs clause was the toughest issue in the bargaining and was only resolved a few hours before the midnight deadline, which had to be extended for four hours to wrap up-other details, including the money package.