A month ago, President Reagan's top advisers ended a series of informal meetings at the White House believing they had reached a consensus that there must be a new round of cuts, including, as some now recall it, a significant paring of the increases in the once-sancrosanct defense budget.

But in an administration where familial rivalry is at times executed with Shakespearean flourishes that early August budget-cutting consensus proved to be nothing more than a midsummer's nice dream.

Instead, the top officials of the Reagan administration wound up embroiled in a public, protracted battle over whether they should cut defense spending significantly, slightly, or not at all.

And the more they battled, in the glare of their now-public arena, the more things began to slide the way of the Pentagon generals and admirals, and their designated gladiator, Defense Secretary Caspar W. Weinberger.

Weinberger was locked in a fiscal and philosophic battle with the president's director of budget and management, David A. Stockman, whose arguments for defense cuts were well known, and the president's chief of staff, James A. Baker III, whose strong arguments for a significant scaleback in the Reagan defense increases were surprising to others in the White House inner circle who had always known Baker to be more of a manager than an advocate.

In their meetings with the president, both Stockman and Baker argued vigorously that there had to be truly significant cuts in the defense spending increases if the budget was eventually to be balanced, if the Wall Street markets were to be truly convinced, and if the Reagan economic policies were eventually to succeed.

Weinberger won, as those close to the president now see it, in part because of his patience and skill, and in part because of his ploys: throughout his meetings with the president, he consistently spoke of the two alternatives as "the Reagan budget and the OMB budget;" and his budget charts showed the Reagan budget measured with large-size soldiers carrying rifles, while the OMB budget was represented by small soldiers without rifles, and smaller warships and planes.

But Weinberger won, most of all, according to one presidential adviser, because:

"We were starting with a president who just did not want to do anything with the defense budget except increase it. It runs against the grain for him to cut defense spending."

He added: "Cap did just what any good Cabinet officer should do. He fought for his department, and he fought hard."

And this brings up another interesting aspect of the great defense budget battle of the summer of '81. It became clear, during the intramural calesthenics that there are times when the unique and much-heralded Reagan Cabinet government machine loses its theoretical one-for-all-and-all-for-oneness and functions instead just as all other administrations have in presidencies past, with the Cabinet members fighting fiercely in behalf of their constituencies and the White House aides winding up in a strong enforcement role as interlocutors and intermediaries.

That is the way it happened in the battle over defense spending.

Before the final decisions were done, the struggle produced personal strains that reached several administration levels. A couple of weeks ago, Weinberger and Stockman were barely speaking, according to several informed sources, who say that both have worked to smooth their relations since. So, too, there were rumblings of displeasure from Pentagon officials about Reagan chief of staff Baker.

And in August, when the president's top aides were scattered about the vacation landscape, tensions developed between presidential counseler Edwin Meese III and Baker, although senior presidential aides say both have been working hard to assure these strains are eased and that there is a personal as well as professional harmony between them.

In July and early August, the president's senior advisers, among them Baker and Meese, discussed the administration's upcoming fiscal/political problems.

The consensus was reached, according to several White House sources, that there had to be a new round of cuts in all departments and agencies, including the defense budget that Reagan had vowed to increase by 7 percent a year.

Several senior presidential aides came away from those sessions believing their budget-cutting headaches were going to be cured in the comparatively painless, semiprivate comfort of their own inner councils. All that remained, they felt, was for this defense-cutting consensus to be worked out in the Cabinet machinery presided over by Meese.

Meese, however, recalls it with somewhat different emphasis. "My view was that we were saying we were going to look into all budgets, including defense, to make some additional economies," Meese said. "I think it was everybody's understanding that we would only be looking at all budgets, including defense. That was the way I understood it, and the way Cap did. But everybody had their point of view."

Baker's point of view, when he arrived at the California White House after a two-month vacation for a meeting on defense spending with the president and his top officials, was that all had agreed defense spending would be cut.

Baker spoke out strongly for reducing the amount of the Reagan defense increases. Meese was far less opinionated, according to officials who were there. And when Weinberger argued against making any cuts in defense spending at that session, Baker decided to try to do what he could to push matters toward a decision.

He gave interviews to the wire services saying that he believed the president was "prepared" to cut defense spending by $20 billion to $30 billion in fiscal years 1983 and 1984.

Those were the two options that Stockman had sent to the Pentagon, and Baker has maintained that those were the only two options he believed were under consideration.

Another White House official has elaborated, however, saying: "Baker thought it out in advance before he gave those interviews. He felt it would help force a decision by saying what he said."

One thing it did was to help force Weinberger into hardening his public rhetoric. In Hawaii, at an American Legion convention, Weinberger said he was "concerned about some of the economic arguments which are being advanced against needed strengthening of our defenses."

Back in Washington, the president held a number of meetings with his advisers on defense spending. Finally, on Wednesday afternoon, in the Cabinet Room, Reagan ended one session by giving Weinberger and Stockman some defense spending figures that he said were "exactly in the middle" of what they had been advocating.

"Now why don't you fellows get together and see if you can work it out in this area?" the president said, according to one official who was there.

They came back with new figures, and there was another meeting, and then the president took it all up to Camp David for the weekend.

He made his decision the first day on the mountaintop. His final decision was not right down the middle, after all; it was close to where Weinberger had wanted it all along: a modest trim of $13 billion for the next three fiscal years.

The Reagan experiment in Cabinet government had, in this instance, turned into one-on-one advocacy as usual, with the Pentagon's Weinberger, emerging victorious.