Syrian President Hafez Assad, struggling to overcome isolation abroad and armed opposition at home, has made his two biggest gambles ever since coming to power 10 years ago, singing within a month of each other a surprise unity agreement with Libya and a controversial cooperation treaty with the Soviet Union.

With a reputation for extreme caution and careful calculation, Assad's two latest decisions at first seem totally out of character so loaded are they with risks for the future of his lately troubled regime.

The unity accord with Libya's visionary Muammar Qaddafi, if carried out to the letter, could easily arouse serous internal unrest, undermining rather than strengthening his rule. And Assad's friendship treaty with Moscow, at a time of enormous strains and shifting alliances in the Arab world, could well serve to isolate him even further.

It is just such outcomes that Assad's enemies and even some neutral diplomatic observers here are already predicting, with potentially dire consequences for his hold on power.

But the view of Damascus is totally different. Syrian officials argue that the unity accord will boost Assad's popularity and credentials as the chief standard bearer of pan-Arabism, an ideal which still has enormous appeal among the Arab masses and remains a primary objective of his own socialist Baath Party.

The treaty with Moscow, on the other hand, will establish Syra as the main Arab counterweight to Israeli military might and spearhead of the radicals' Steadfastness and Confrontation Front against the Camp David accords. This, officials here feel, will force the West to deal with Syria and end its exclusion form international councils of peace.

"Who is isolated?" retorted Ahmad Iskandar, the Syrian information minister and member of the Baath Party's excutive committee. "Is it we who are isolated or the Camp David parties who are isolated?"

"Even those who want to flatter the U.S. administration do not dare to support [Camp David] in front of their people," he said in an interview. "Syria has all the Arab people on its side regardless of their government or the Camp David parties."

These Syrian moves came against a background or regional isolation and internal political difficulties. Assad, has apparently decided his best chance to overcome these obstacles rests on the twin gambits of closer ties with Libya and the Soviet Union.

Libya, after all, has the wealth to offset easily the possible loss of more than $1 billion in assistance to Syria from conservative Arab nations. The Soviet Union, on the other hand, alone has the sophisticated military wherewithal to match Israel's American-provided arsenal and perhaps most importantly to keep Assad's armed forces the solid pillar of his regime it has been to date.

The Syrian government has already leaked a report here that Qaddafi has expedited, since the signing of the Syrian-Libyan unity agreement on Sept. 10, $1 billion to Moscow to pay for new Syrian arms and another $600 million directly here to relieve an acute shortage of hard currency.

Whatever the pecuniary and military gains flowing from his new alliances, Assad is also using them, Western diplomats here say, in a bid to break his diplomatic isolation and force the West to deal with Syria in any new peace initiative following the expected collapse of the Camp David peace process.

The Syrians sincerely believe, according to these diplomats, that Jordan, Saudi Arabia and Iraq are plotting together to prepare a new initiative in conjuction with Western Europe that will again leave Syria out in the cold and without Arab support for its struggle to get back its Israeli-occupied Golan Heights.

Of Syria's two new alliances, the most important to Syrian strategic considerations is undoubtedly the treaty signed by Assad and Soviet President Lenid Brezhnev in Moscow Oct. 8.

Western analysts here are convinced that Assad, who just celebrated his 50th birthday, carefully calculated the potential pluses and minutes of a closer, formal alliance with Moscow before finally taking the intiative late this summer to sign the long-proffered accord.

"Asad resisted signing one for 10 years," remarked one. "There has got to be something very concrete in it for him."

To all appearances, the treaty contains the standard bland and vague language of otehrs signed in the past few years between Moscow and its Third World allies.

Syrian officials themselves ae emphasizing the fefensive nature of the treaty and expected political rather than military impact on Israel and the West.

Most likely, the pact involves a large, new arms deal. Observers here note that Gen. Mustapha Tlas, the Syrian defense minister, stayed on in Moscow after Assad's departure, and it is asummed here he discussed the Syrian arms shopping list with Soviet authorities.

Whether more sophisticated Soviet arms would eventually cause Syria to abandon its very careful posturing to avoid an open confrontation with Israel, either on the Golan Heights or in Lebanon, where Syria has 25,000 troops acting as the mainstay of the inter-Arab peacekeeping force there, is a matter for pure conjecture.

"We want to increase our defensive capabilities to face the most modern war machinery put at the disposal of Israel and which is directed against our people," explained Information Minister Iskandar.

"Also, we are in need of a strong alliance with our friends to confront the American presence which is escalating in the area and aimed at destablizing the Arab liberation movement and suppressing Arab aspirations," he continued. t

"We have no option but to increase to the fullest possible limit our alliance with those who proved to be our friends and real supporters," he said. "The Soviet Union has proved to be a strategic friend as well as a faithful friend."

Iskander also noted the parallelism of Syrian and Soviet interests in the current Middle East context, saying, "The Soviet Union has an interest in defending its vital and strategic interests and this meets our interest in standing up to the [Israeli] attacks."

Western analysts here believe that the Soviets would like to gain greater access to Syrian ports and airfields for their military forces. But they doubt the Soviets intend to increase their physical presence much above the 4,000 to 5,000 civilian and military advisers now stationed here since Soviet personnel are being singled our for attack by armed groups linked to the Moslem Brotherhood-led opposition here. Nine or 10 Soviet adviers were reported to have been assassinated this year.