When U.S. banker David Rockefeller visited Brazil last week, he brought with him an increasingly rare import -- cautious optimism over the country's immediate economic future.

"I don't see any reasons which will keep the country from growing," said Rockefeller, who is to step down in April as chairman of the board of Chase Manhattan, one of Brazil's largest creditors.

Such welcomed words of cheer come at a gloomy time for the world's 10th largest economy. Inflation, at 109 percent, is the highest in memory, and the national debt, at $54 billion and climbing, is the largest in the developing world.

Rockefeller's international banking colleagues are increasingly wary of Brazil, and recent loans have been for shorter terms and at higher interest rates than usual.

"If I owe you $1 million, I don't sleep at night. If I owe you $50 billion, you don't sleep at night," cracked one Brazilian banker recently with a smile.

Brazil's crippling dependence on imports for 85 percent of its oil needs is widely blamed for the swelling debt and inflation. In 1974, with the debt at $12 billion, 14 percent of the country's foreign exchange paid the oil bill. aThis year, oil is expected to consume 55 percent, or $12 billion, of export earnings. Simply servicing the debt this year will chew up another $12 billion, forcing Brazil to borrow more money.

Until September, Iraq supplied 49 percent of Brazil's imported oil. The Persian Gulf war suddenly shut down the flow, sending buyers scurrying around the globe. New suppliers have been found, but Brazil's annual oil bill jumped by $2 billion, and the government has been forced to increase gasoline prices by 18 percent to more than $3 a gallon.

Current bad times follow a period of soaring economic optimisim last year when Antonio Delfim Neto, 52, was named planning minister, the second most powerful post in the government. Brazilians hoped Delfim would duplicate his feat of a decade ago, when he was credited with masterminding "the Brazilian miracle" of fast growth and low inflation.

Back in power, Delfim announced an unorthodox program of " outgrowing" inflation by doubling exports in five years and pumping millions of cruzeiros into agriculture -- neglected in the industrial surge of recent years. Brimming with self-confidence, he set out to break the inflationary spiral with highly publicized limits on interest and exchange rates.

But after a year of Delfim's medicine, inflation is running at more than double his forecast of 50 percent, the cruziero has lost half of its value against the dollar, and the trade deficit is expected to be $3 billion -- higher than last years.

A recent Gallup poll reported that two-thirds of Brazilians consulted see inflation as the nation's most pressing problem. Last week, the central bank started printing 5,000-cruzeiro notes. The 1,000-cruzeiro bills went into circulation only last year.

In a neighborhood supermarket here a housewife dropped a 10-pound sack of rice into her cart and complained to a visitor: "160 cruzieros 10 days ago, 190 today, and next year it will be another price. Where we used to eat meat, we now eat eggs."

The ruling military is in an uncomfortable situation. In 1964 it seized power backed by thousands of city housewives who took to the streets in protest against the then-unprecedented inflation rate of 88 percent.

Today, President Joao Baptista Figueiredo's liberalization policy has meant not only that all political prisoners have been freed and press censorship has ended, but also renewal of the strikes and street demonostrations once prohibited by the military. Consumers so far have confined their protests to the home, but when a meat boycott erupted six months ago against price increases, Figueiredo was quick to endorse it.

Inflation has made savings difficult, pushing many Brazilians to seek shelter in tangible investments -- especially real estate. The national housing bank reported recently that the price of a three-room apartment in Rio's chic southern zone has increased by 3,500 percent since 1972. The money required to buy that apartment eight years ago would buy a good stereo system today.

Chastened by the economy's less than bright performance, Delfim recently announced an abrupt return to more orthodox economic policies. To minimize damage to his political aspirations, the new approach was unveiled Nov. 4, when many Brazilians were distracted by the U.S. elections.

The new moves will tighten credit as a means of slowing the economy and reducing inflation. Delfim is also taking steps to reduce his generous agricultural credits, which had been supplied largely by printing more money.

Foreign bankers have discreetly applauded both moves, noting that the steps are in line with a program that the International Monetary Fund would impose if Brazil asked for a loan. Although Brazil so far has declined to do so, accusing IMF of anti-Third World, restrictive regulations, many financial analysts predict a change of heart if the debt reaches a predicted $65 billion next year and private capital markets dry up in apprehension.

Although few observers predict that Brazil will default on its debt, such an occurrence would "be like a nuclear war," said one. In 1970, private foreign banks held 20 percent of the debt. Today they hold 80 percent.

In his many public statements here last week, Rockefeller tried to soften the Brazilians up on resorting to the IMF. He assured them that there was no reason for "embarrassment" about borrowing from the fund, noting that Britain has made such a move in the past.

However, an IMF-mandated austerity program could push growth levels below the 4 percent needed to emply 1.5 million workers entering the work force each year. Ensuing social unrest could torpedo the government's redemocratization policy.

"When average income is low, many families don't have savings, and it is impossible for them to survive without help," said Paulo Rabello de Castro, editor of Conjuntura Economica, a respected economic monthly here. "It's logical for them to try to redistribute income on their own -- either through political action or crime.

A Sao Paulo security firm reports resquests for guards are up 60 percent over last year, and bank robberies in Rio are almost a daily occurence.

Last Thursday, while Rockefeller was meeting with reporters and industrialists, armed men walked into a Chase branch in the working-class northern zone and stole $20,000.