The Carter administration, which a few months ago rejected the idea of making Egypt a U.S. military surrogate in the Middle East, now is pursuing a relationship that would arm Egypt with some of the most sophisticated weaponry in the American arsenal, including F16 jet fighters.

As part of the frantic gear-shifting by U.S. policymakers in the wake of the Afghanistan crisis, the administration is seeking congressional approval to be a long-range reequipping and modernizing of the Egyptian armed forces in a way that would make Cairo's basic equipment almost exclusively American.

This program, tentatively expected to provide Egypt about $4 billion in military credits over five years, is perhaps the most telling sign of how broadly U.S. strategic thinking has changed since the Dec. 27 Soviet invasion of Afghanistan.

Before Afghanistan, even though the Egyptian-Israeli peace treaty had given legitimacy to the idea of U.S. military aid for Egypt, it was generally accepted that the quantity andquality of any such aid had to be significantly less than that provided to Israel.

Senior administration officials, recalling how hopes of maintaining Iran as a Middle Eastern military power had collapsed with the fall of Shah Mohammad Reza Pahlavi, said openly they didn't believe it would be wise to lavish on Egyptian President Anwar Sadat the same kind of sophisticated arms that had been made available to the shah.

Even if the administration wanted to take that course, it would have had no chance against the powerful pro-Israel bloc in Congress.

All that changed with Afghanistan. The administration, seeking to check Soviet threats to the Persian Gulf and its oil, is looking for all the friends it can find in the region. Since Egypt is the largest and most militarily powerful country in the Arab world, U.S. policymakers suddenly have found a lot of compelling new reasons for keeping Sadat on their side.

The same kind of thinking also seems to have taken hold on Capitol Hill. Although Israel strongly opposes beefing up military aid to Egypt, the Israelis, as one reliable source puts it, "have counted noses in Congress and know they can't stop it."

As a result, the Israelis are known to have fallen back on this strategy: don't try to defeat the administration's request for Egypt, but seek instead to water down the amounts and types of equipment involved and to stretch out the process of delivery to the Egyptians.

Initial indications are that even these Israeli efforts aren't likely to meet with much success. Testifying before a House subcommittee last week, Harold Saunders, assistant secretary of state of Middle East affairs, defended the administration's request as "a modest program" and noted that it would still give Egypt less than Israel receives from the United States. i

Although only a few committee members quarreled with his use of the term "modest," the program outlined by Saunders actually amounts to a sizable upgrading of what the Carter administration originally planned for Egypt.

For months, Washington had resisted proposals by Sadat that the United States provide his armed forces with massive amounts of modern equipment. When Defense Secretary Harold Brown visited Cairo a year ago, Sadat started him with an arms shopping list that U.S. officials say totaled close to $15 billion.

Sadat's argument that a strong, pro-Western military force in the Middle East was in U.S. interests sparked little enthusiasm in Washington. Instead, the dominant attitude her was summed up at a Senate Foreign Relations Committee hearing last April when Brown and Secretary of State Cyrus R. Vance sat nodding approval as committee Chairman Frank Church (D-Idaho) warned sternly:

"The last thing we want to do is build up a new military colossus out there and then find it turning out like Iran, with Sadat no longer president and the whole place in chaos."

Indeed the administration had no such intention, Vance and Brown replied. While conceding that President Carter did want to give Sadat some military help, they stressed that it would be limited to the kind of equipment Egypt required for defense against threats in its immediate neighborhood.

Typifying the kind of aid Washington had in mind, the officials cited the existing commitment to sell Egypt about 35 F5E fighters. These are short-range planes considerably less sophisticated than the F15s and F16s, which are the most advanced fighters in the U.S. arsenal and are being provided to Israel.

Following the signing of the Egyptian-Israeli peace treaty, the administration put together a special military aid package for the two countries.

Israel, which regularly receives about $1 billion a year in military credits, was promised an additional $3 billion in credits and grants over three years. Egypt would receive $1.5 billion in credits -- $500 million annually in the 1979, 1980 and 1981 fiscal years.

That appeared to be the outer limit of the U.S. commitment, until the Afghanistan crisis ignited the attempt to rally support throughout the Middle East and Southwest Asia by offering military aid to Pakistan and welcoming requests from just about any other country that might want it.

In that suddenly changed environment, sources say, it was impossible not to do more for Sadat, America's closest friend in the Arab world. The result was a commitment, decided on last month, to a substantially greater role in helping Sadat modernize his forces over several years.

As a first step, the administration has asked Congress to approve and additional $350 million in military credits, to make the total request for the 1981 fiscal year, which begins on Oct. 1, $850 million, In addition, the administration has promised Egypt to increase the request for the ensuing 1982 fiscal year to $800 million.

In his testimony last week, Saunders said no decisions have been made about commitments beyond that point. However, administration sources say privately the tentative plan is to continue granting credits at this $800 million annual rate for at least three additional years -- a total of $4 billion over a five-year period.

Although Saunders mentioned the possibility of Egypt filling some of its military needs through purchases from Britain and France, essentially the United States would become Egypt's principal arms supplier. The Egyptian forces, which now use mostly Soviet equipment left over from Sadat's old alliance with Moscow, would become dependent on American weapons.

Even more significantly, the policy shift will broaden significantly the type of weaponry the Egyptians can buy. The F16 jets are the most significant item.But the expansion also includes such previously denied equipment as M 60 tanks and advanced air defense systems.

Saunders said decisions are still to be made on other modern weapons and equipment, and he conceded that one of the items under consideration is the F15 fighter, a plane even more advanced and faster than the F16.

As the Israelis and their congressional supporters are quick to point out, this is a considerable escalation of the essentially localized and defensive equipment that the administration was characterizing as Egypt's main need only a few weeks ago.

Israel's concern is that the unstable nature of Middle Eastern politics could lead to Sadat's replacement by a more radical Moslem leadership that might repudiate the peace treaty and use Egypt's new American arms in yet another war against Israel.

Despite the administration's denials, the Israelis remain intensely suspicious that Washington has put aside its resolve not to repeat the mistakes it made in Iran and is measuring Sadat for the shah's old mantle of pro-western gendarme.

It's an argument that the Israeli lobby in Congress will be making with increasing frequency as the administration's request makes its way through the legislative process. But, given the growing concern about a potential U.S.-Soviet struggle for influence and access to the Persian Gulf, Congress is likely to agree that arming Sadat with America's best weapons is a risk worth taking.