With inflation rising at a rapid rate and with an unprecedented budget deficit, China is retrenching economically in every direction.

Consumers are being told they will find fewer goods on the shelves, and major projects involving foreign companies are being cut back sharply, leading a number of the companies to pull up stakes and leave Peking.

In a front-page article today, the official party paper, the People's Daily, called on China's long-suffering consumers to make "some necessary sacrifices" while the party tries to control inflation and wipe out last year's deficit of $7.4 billion.

The newspaper also warned that the nation's new economic readjustment policy will close down factories and increase unemployment, an already serious problem dramatized by unofficial estimates of 20 million jobless in an urban labor force of 120 million.

Meanwhile, U.S. companies, including the San Francisco-based Bechtel International Services, V.M.W. Kellogg Co. and Caterpillar Far East Ltd. are planning cutbacks here, apparently signaling a trend among companies chastened by China's austerity drive.

The disillusionment and at least partial retreat of these firms comes as a heavy blow to Peking, which professes still to be counting on foreign investment and know-how to help modernize its economy once it passes through its current straits.

Bechtel, an engineering and construction concern, entered China in late 1978 in the full blush of business optimism encouraged by the grandiose plans of Chinese officials who at the time were calling for 120 large industrial projects by 1985.

More than two years later, Bechtel, still without a major contract, plans to leave its two-story office in a Peking guest house and cut its staff from four full-time employes to one, reliable business sources said.

The one staffer will work in a smaller office joined by a traveling Bechtel representative about 10 days a month.

For Bechtel and other foreign firms, the rather grim business prospects in China make the sizable costs of running a Peking office hard to justify.

The cost of Bechtel's office alone is to run $650 a day.

The once busy pace of the foreign business community began slowing considerably in December after the government, unable to find a remedy for a deficit that reached $7.4 billion, canceled or indefinitely postponed more than $1.5 billion in large capital projects.

The pessimistic business mood turned even gloomier three weeks ago when Chinese planners announced a 40 percent cut in the capital construction budget for this year -- a reduction from $55 million to $300 million.

Although the December cuts wounded Japanese frims the deepest, American companies involved in large-scale mining and petrochemical projects were stunned last month when Peking canceled or indefinitely put off their work as part of its economic readjustment.

Openly worried about a loss in its credibility, China has accepted blame for the project cancelations and has promised to compensate companies for any losses. At the same time, Peking has asked the firms for patience, promising better results when its economic troubles are remedied.

Today's article recounting the bad news for consumers not only explained for the first time the impact of China's new austerity program, but represented the first official backpedaling from the 1979 policy of increasing material incentives for workers and peasants as a way to spur their labor productivity.

In the past two years, Peking has increased the disposable income of the average urban family by granting wage increases and bonuses to factory and office workers. In the countryside, the government raised the price it paid for agricultural goods on state farms.

With more generous agricultural prices, peasants have produced more food for the cities, which has meant almost unlimited supply today of previously rationed goods, such as meat, sugar, some vegetables and certain kinds of soap.

At the same time, department stores in big cities suddenly have been stocked with Western-style clothing and electronic gadgets such as calculators, tape recorders and refrigerators.

The short-lived consumer boomlet has even begun to alter the common Chinese cityscape. Among the throngs of cyclists clad in blue Mao suits in Peking and Shanghai today are a few motorists wrapped in trenchcoats and driving Japanese-made mopeds.

Although the new consumer goods fascinate the Chinese, who form large crowds to inspect them, most items are priced too high for the average worker, who earns $40 a month.

Moreover, inflation has diminished spending power despite wage increases and bonuses. Peking has estimated overall inflation at about 6 percent, although foreign analysts put the figure at twice that amount. Some food prices have risen 20 percent in the past year.

In today's article, the People's Daily cited inflation and the huge budgetary deficit as "potentially explosive dangers" justifying a temporary halt in consumerism and the imposition of a "down-to-earth" policy.

Readjusting the economy is consistent with the long-term interest of all Chinese, the article said, but the new austerity will have some short-run costs -- the loss of jobs and the end of agricultural prices rises for peasants.

In the foreign business community, V.M.W. Kellog Co., another large engineering and construction firm that has received eight multimillion dollar contracts in China since 1973, will withdraw its Peking representative next month, leaving an office run by Chinese employes.

John Bing, Kellog's manager of China operations, said the Chinese government has made it clear that its ongoing economic readjustment means little work for foreign contracting companies. "Realities are such that you don't make water flow up hills," he said in an interview.

A third American-based company, Caterpillar its full-time representative, while the British Petroleum Co. is planning to cut down its 15-member staff in Shanghai to one representative after the firm completes current geological work.

A BP representative in Peking said the firm decided to reduce its staff because there is no more work to be done until the Chinese send out bids for offshore oil drilling rights. He stressed that Peking's economic troubles did not influence BP's decision to scale down its operations here.

Among the Japanese projects hit hardest by China's readjustment is the huge Baoshan steel complex near Shanghai, where Peking canceled orders valued at $500 million. Peking's decision to cancel the steel project's second phase also is expected to cost Japanese firms $225 million in other contracts, Japanese businessmen said.