OUTSIDE the Slovenian hamlet of Vrhnika, a Yugoslav MI-8 Army helicopter swoops low over a wooded ridge, drawing bursts of automatic-weapons fire as it bolts for a nearby garrison.In the valley below, dozens of Soviet-designed T-72 tanks are deployed to protect the Army base's perimeter, which has been surrounded by Slovenian territorial defense forces since last weekend. Opposite the Ivan Cankar garrison, located about 20 miles west of the Slovenian capital Ljubljana, huge loudspeakers blare out local radio broadcasts, part of a round-the-clock harassment campaign to demoralize troops inside. The Slovenes have cut off electricity and water supplies to Cankar and other Army installations and isolated units still in the field. Maj. Radomir Kostic, adjutant to the commander at Ivan Cankar, says his base has enough food and water to last for several months. "We're in good shape." Other besieged Army units are not. In response to the pressure from armed nationalist forces and to the Slovenes' demand that the Army return to its barracks without tanks and guns, the Army launched a fierce counterattack July 2. Federal bombing raids against Slovenian defense units near Croatia and Slovenian broadcasting transmitters in Nanos, Krvavac, and Hum were necessary, the Yugoslav Defense Ministry said, because Slovenian forces had "rudely violated the cease-fire agreement." The federal Army began moving against Slovenia last week after the republic declared full independence along with its neighbor and ally, Croatia. Despite a cease-fire agreement reached June 30 between federal and Slovenian leaders, sporadic clashes between the Yugoslav Army and the Slovenian territorial defense have continued in the tiny Alpine republic of 2 million. During the heavy fighting, federal troops captured many of Slovenia's 27 international border crossings and strategic airports. But the republic's mainly reservist militia put up unexpectedly strong resistance and managed to hold or reclaim some objectives. The tenacious Slovenian resistance has stung and humiliated the federal military command. The Army's behavior in Slovenia has also shaken Serb confidence in a force dominated by pro-Communist Serb officers. Although the Army used less than 5 percent of its 180,000 men and 2,000 tanks against Slovenian forces, the spectacle of soldiers surrendering to armed Slovene civilians and defense forces has seriously damaged the Army's reputation. Slovenian officials say that more than 1,270 federal Army soldiers were captured and 782 deserted during clashes with Slovenian territorial defense forces. Hundreds of federal soldiers of all Yugoslav nationalities, including officers, reportedly deserted their Slovenian barracks, answering a broadcast appeal from the Slovenian presidency calling on all soldiers not take part in the "barbaric aggression" against Slovenia. Slovenia's fledgling territorial defense, trained to fight in guerrilla actions, reportedly inflicted heavier losses on the much better equipped federal units. Tank companies, roaring down highways without infantry support, were frequently bogged down in front of barricades of heavy trucks and buses, making them easy targets for Slovenian gunners armed with antitank weapons and rocket launchers. The fighting has claimed the lives of at least 63 people and wounded 142. Slovenian Information Minister Jelko Kacin said some of the soldiers were forced by defense forces to hole up in their tanks for days. "They surrendered massively because they were given an impossible mission," says Mr. Kacin. The Army, trained to defend Yugoslavia's former Communist system and its external borders, is made up of conscripts from all of Yugoslavia's 24 ethnic groups. Some analysts say that full-scale hostilities would lead to massive desertion of Slovenes and Croats. "This represents the beginning of the end for the Yugoslav People's Army," says Anton Bebler, a senior Slovenian military expert. "The whole concept of this old-fashioned Army is now in question." Serbia, with renamed communists in power, vehemently opposes the independence drives of Slovenia and Croatia, which turned to secession after they failed to transform Yugoslavia into a loose association of sovereign states. The showdown between Slovenia and the federal Army is part of a complex web of ethnic rivalries, militant nationalism, and ideological disputes that threaten the existence of this nation of six republics and two provinces. Many Serbs were outraged by the Army's relatively inept performance against Slovenia, considered a much easier target than better-armed Croatia. Aleksandar Tijanic, a prominent Belgrade columnist, demanded the resignations of "the inept generals responsible for troops left without supplies for days." The Yugoslav Army command, in a communique, admitted that it had underestimated the Slovenian resistance, but couched the statement in accusations of Slovenian brutality. "Our great mistake was that we did not think the Slovenes were capable of such methods."