A reversal of a generation of extremely close ties between the United States and Ethiopia was marked by an official sigh of American regret yesterday, with the hope that the strains will not worsen.

Ethiopia's virtual wipe-out of all but the most formalistic American embassy functions in Ethiopia is a dramatic reversal of the U.S.-Soviet pattern of rivalry in that nation.

The United States, from 1953 onward, outbid the Soviet Union as Ethiopia's major arms supplier, to meet "a Somali threat." Ethiopia became the major U.S. client state in the region, and its eastern neighbor, Somalia, the main Soviet client state. But last December, Ethiopia's Marxist military rulers joined the line at the Soviet military window, after vainly seeking major new aid in Washington.

Ethiopia "is a can of worms," one senior U.S. official said last week. The Carter administration, in turn, now reportedly wants to try to improve its relations with Somalia.

President Carter recently was quoted as telling Vice President Mondale, newly assigned to watch developments in Africa: "I want you to tell Cy [Secretary of State Cyrus R. Vance] and Zbig [national security adviser Zbigniev Brzezinski] that I want them to move in every possible way to get Somallia to be our friend."

State Department spokesman Hodding Carter III said yesterday:

"It is no secret that our relations with Ethiopia have deteriorated over the past two years, despite our efforts to maintain our former close ties.

"The expulsion of American personnel by the Ethiopian government confirms the downward drift in our relationship, which we naturally regret.

"We hope that this trent can be arrested. A smooth implementation of the expulsion orders will facilitate the return to a more normal relationship."

Even if that occurs, a "normal relationship" between the United States and Ethiopia will be on an abnormal basis, compared to the past two decades.

Ethiopia's government is closing down all U.S. military and cultural activities except for the American embassy with its Agency for International Development mission office, American officials said. State Department officials said this will remove 341 Americans, officials and dependents, leaving 76 officials - 47 from State; 22 from AID, and seven Defense Department attaches, plus dependents.

Ethiopia, during the reign of the late Emperor haile Selassie, "the conquering lion of Judah," was the greatest recipient of U.S. aid in sub-Saharan Africa. Between 1945 and 1975, Ethiopia received $618 million in U.S. military and economic support, official records show. For over 20 years the United States was virtually Ethiopia's only source of military supply.

At present, U.S. aid is at the level of $18.6 million for economic and food assistance. In February, the United States suspended about $6 million in military assistance because Ethiopia's human rights policy was below newly established U.S. standards.

The State Department spokesman said there is doubt about the current status of the once-potent Kagnew (communication) Station in Ethiopia's Eritrea province, for years the main U.S. prize in Ethiopia.

Kagnew, where there were once more than 3,000 Americans, including dependents, was a primary relay station for the U.S. Army's communication system, a major American naval communications center, an earth terminal for U.S. satellite systems, and a diplomatic communications relay point.

In 1960, the United States secretly agreed to equip and train a 40,000-man Ethiopian army, in exchange for expanding Kagnew. Official records now call it "a tacit quid pro quo." At tha time, according to a 1970 Senate investigation, newly independent Somalia had only 2,000 men under arms and also sought U.S. weaponry. In 1963, the Soviet Union became Somalia's military supplier.

Over the years the military rivalry between Ethiopia and Somalia for primacy in the Horn of Africa greatly intensified, with the port of Berbera becoming a major Somali installation for Soviet power in the sea lanes from the Indian Ocean through the Gulf of Aden and into the Red Sea.

State Department spokesman Carter said yesterday that "we had informed the Ethiopian government that we intended to close the Kagnew Station" which "was no longer needed" because of "technological developments." Satellite communications replaced many of the Kagnew operations.

The United States now has 26 civilian and 12 military officials plus four dependents at Kagnew, Carter said.

He added, "It is our intention to withdraw our military personnel, including contract personnel, and equipment" from Kagnew. He said as far as is known, "the Ethiopians are guarding teh Kagnew installation."