Two inspection teams found serious fire-safety deficiencies in the U.S. Embassy here months ago, and several hundred thousand dollars worth of special fire-protection gear was arriving for installation at the time of the fire that swept the building's secret upper floors last weekend, it was learned today.

Some of the shortcomings found by the inspectors had already been corrected, but a crucial improvement - installation of a sophisticated, computerized smoke- and heat-detector - had not been made because its components had not arrived from America.

Three of the major deficiencies - inadequate fire escapes, too little emergency lighting and a lack of respirators of firefighters - had been corrected at the time of the blaze.

Three other improvements had not been made. They were:

Increasing the electric power supply to prevent overheating of the wiring in walls and floors.

Installing a sophisticated smoke- and heat-detection alarm that would constantly monitor the entire building and flash an instant warning.

Installing fireproof and secure metal fire-doors on several floors to make interior stair wells safer as fire escapes.

Embassy administrative counselor Tom Tracy said the building was projected from overheated wiring by circuit-breakers and similar equipment in the basement. He said that overheating was a threat chiefly on hot summer days, when window air conditioners were in operation, and that as a safety precaution, many units had been disconnected.

He said the night of the fire was relatively cool, and presumably few air conditioners in the living quarters on the second through sixth floors were operating.

Tracy said that the embassy requested the stepped-up power in August 1975 and the State Department approved $50,000 for it a month later, but the Soivet agency that provides services to diplomats had not started work on the job.

Tracy said that although the embassy security staff had early warning from temporary smoke-detectors that the building was afire, the heavy smoke set off alarms in several places and confused embassy Marine firemen about the source of the blaze.

He said he believes that the sophisticated new detection system, designed to pinpoint heat as well as fire, could have led firemen to the source of the blaze soon enough to extinguish it before it engulfed the upper floors. Some of the equipment had been slipped from a U.S. supplier and was to be installed when the rest of the system arrived in September.

The embassy burned for 18 hours from Friday night through Saturday afternoon, the fire gutted the entire floor, caused the roof to collapse and seriously damaged parts of the ninth and tenth floors.

The three floors house the political, economic and cultural sections of the embassy as well as top-secret code and communications gear and the supersecret offices of the military attaches. No one was seriously injured, but the fire has disrupted the embassy's work.

Los Angeles Times correspondent Dan Fisher reported:

Embassy officials said a combination of normal lead times for ordering new equipment and the slowness of the Soviet bureaucracy in responding to requests accounted for the delay in making the recommended safety improvements.

Not all embassy personnel are convinced that there was enough effort to correct the deficiencies, however. "They were playing Russian roulette on this and they lost," said one.

A meeting to discuss the situation has been called for Thursday under the auspices of the American Foreign Service Association, the bargaining agent representing State Department employees.

A copy of an unclassified cable sent by the association to Washington and posted outside the embassy's administration office reads in part: "Emotional and psychological strain of fire itself is intensified by realization that problem of inadequate and overstrained electrical system, which seems to have been cause of the fire, still exists, with no remedy in sight."

Ambassador Malcolm Toon said at a press conference last Saturday: "We think the fire began from an electrical fault. We all have to face the fact that we are occupying a building that is somewhat less than perfect."