Gearing up to go out of business, the six Warsaw Pact nations signed an agreement Saturday on how to divide their inventory of tanks and artillery, the last obstacle to a European conventional arms treaty that will be signed in Paris later this month.

The Soviet-led alliance has been plunged into an identity crisis by the sweep of Western-style democracy through Eastern Europe. Kremlin officials have indicated that they may be willing to see the alliance disbanded as early as summer, a Hungarian official disclosed.Soviet officials have been struggling to hold together the military bloc created in 1955 to counter the North Atlantic Treaty Organization.

But the East European partners have all sworn off joint maneuvers and have pledged much of the government money that would have been spent on defense to restructuring their failing economies along free-market lines. One former Warsaw Pact member, East Germany, has already been absorbed by NATO after German reunification.

"We've had indications that the Soviets might be willing to see the pact disbanded by the middle of next year," said the Hungarian official, speaking on condition of anonymity.

At the weekend meeting, foreign ministers of the six remaining Warsaw Pact nations at first bogged down over the details of how to parcel out hardware that will be retained but removed from active duty, delaying signature of the distribution accord.

Negotiators for Hungary, Czechoslovakia, Poland, Romania, Bulgaria and the Soviet Union agreed after extended talks that about one-third of the 3,500 tanks to be mothballed should be stored outside the Soviet Union. That concession seemed to appease the East European partners, according to sources involved in the negotiations.

Details of how the alliance assets would be shared were worked out at a pact meeting in Prague, Czechoslovakia, last weekend.

The agreement fixes distribution of 20,000 tanks and an equal number of artillery pieces among the member nations.

Western officials at the Vienna-based conventional arms talks said the Warsaw Pact plan was the last serious hurdle to a treaty to be signed Nov. 19 in the French capital.

Under terms of the conventional weapons agreement, NATO and the Warsaw Pact will be limited to the same levels of tanks, armored vehicles, aircraft and artillery. But deeper cuts will be required in the Warsaw Pact's more substantial arsenal to comply with those ceilings.

Although the Warsaw Pact continues to function as a negotiating team at European disarmament talks, it is already essentially defunct as a military alliance.

Hungary announced months ago that it would no longer take part in joint military exercises, and other members states echoed that position at a news conference after the distribution accord was signed.