Burgeoning energy needs have made the United States the largest trading partner of Algeria despite ideological differences with this selfproclaimed radical leader of the Third World.

Faced with the short-run threat of financial strangulation. Algeria has staked its economic stability over the next 25 years on sales of liquefied natural gas to the United States.

Such implicit dependence grates on the fiercely indepedent Algerian who are torn between their fascination with American technology and their commitment to force the United States and other industralized nations to give the Third World a bigger economic and political role.

The United States already buys more than half of Algeria's dwindling crude oil production and deals have been signed for multi-billion-dollar purchases of its future gas exports.

This economic relationship has improved relations that were severely strained not long ago.

In the light of these past differences, however, the Carter administration is proceeding with caution.

Within a year of Algeria's independence from France in 1962. U.S. Algerian relations were strained when then President Ahmed Ben Bellain-furiated an initially well-disposed President Kennedy by flying directly to Cuba after a Washington visit.

Relations further deteriorated during the growing American involvement in Vietnam. The Algerians identified the north Vietnamese and Vietcong cause with their own 7-year war of independence. The ties were formally broken during the 1967 Arab-Israeli war. Algeria further offended official Washington by participating in the Arab oil boycott during the 1976 Middle East conflict.

Full diplomatic relations were reestablished in November 1974 and Algeria finally sent an ambassador to Washington less than six months ago.

Partly because of the Algerian oil and gas industry's need for technology American companies did a steadily growing business here even during the period of suspended diplomatic relations.

Trade surged with the enormous increase of U.S. energy imports. Last year the United States displaced France as Algeria's top commercial partner. Between 1973 and 1976. American purchases of Algerian oil increase from $200 million to $2.2 billion.

France still exports more to Algeria than does the United States. Despite some $6 billion in orders for American goods - mostly high technology plant for the oil and gas industries - the U.S. latest trade deficit with Algeria is $1.6 billion.

American oil buyers, usually small to mediumsized companies, pay a premium for Algeria's light low-sulfur crude, which satisfied refiners' needs for gasoline-heavy fuel and environmental lobby demands for low pollution.

As an American source put it: "We just sort of drifted into the oil situation."

U.S. interest in Algerian gas was more calculated. Negotiators demanded that Algeria itself pay for the lion's share of heavy local infrastructure costs involved in the nascent technology of liquefying natural gas, transporting it frozen in special tankers and then turning it back into gas at its destination. Despite one massive gas sale to Italy, the United States is the only visible outlet for most of the liquefied gas exports.

If Algeria is unable to sell the liquefied gas elsewhere, at some undefined crossover point it will be looked into a longterm relationship with the United States the theory goes.

Left unsaid is the knowledge that once Algeria consented to such heavy infrastructure an embargo would be unlikely because of Algeria's need to sell gas to pay off debts associated with the investmen.

Negotiations with American firms - and the influential Federal Power Commission - began in 1969. Despite the services of such Washington lawyers as Clark Clifford and William P. Rogers, only one deal - the first El Paso contract covering 10.5 billion cubic meters annually for 25 years - is definitely on Deliveries are now expected in early 1978 some two years behind schedule.

Other deals - involving El Paso. Tenneco and Panhandle - may eventually involve between 25 and 20 billion cubic meters annually for the same duration.

Deliveries on that scale were made possible only since the Carter administration lifted President Ford's ceiling limiting natural gas imports from any one country to 28 billion cubic meters annually.

With at least $6.6 billion in outstanding debt. Algeria already is experiencing difficulty borrowing in world money markets for its end of the gas deals.

Algerian officials foresee the debts service ratio already 18 per cent rising as high as 25 per cent by 1982 before declining. Some Western specialists suggest that the high point may be nearer 30 per cent.

The costs are staggering. World Bank estimates recently suggested that Algeria would have to borrow $3 billion annually for the next five years to meet its gas infrastructure costs.

Still. Algeria feels it has no other choice since its proven oil reserves are expected to run out in 15 to 18 years, barring a major discovery.

Signs of Algerian interest in the United States reflected in a major cultural agreement expected to be signed soon.

Yet the United States is still a favorite whipping boy for the officially controlled Algerian media. Government authorities tell American diplomats not to pay any attention to the strident attacks.

Algeria has a reputation over the years for mercurial and temperamental dealings with most of the countries with which it maintains relations. As one Western diplomat remarked, "You Americans may yet end up learning as have the French that close relations with Algeria more often than not mean more day-to-day problems."