The International Monetary Fund and Brazil hope to complete arrangements this week for a $4.5 billion loan desperately needed to keep that nation solvent, an IMF official said yesterday.

The agreement being negotiated by the international agency and Brazil would provide immediate funds to the cash-starved country and also encourage private banks in the United States and elsewhere to resume their lending.

Banks virtually ceased making new loans to Brazil last August in the wake of the Mexican financial crisis, which triggered worldwide fears about the solvency of the major Latin American nations. "Commercial bank loans to Brazil dried up," said economist John Williamson of the Institute for International Economics. Brazil had been borrowing about $17 billion a year from commercial banks both for fresh needs and to meet payments on existing international debt, which now totals more than $80 billion.

In addition to the $4.5 billion IMF loan, Brazil is seeking additional loans from U.S. and European governments, and will meet with officials of private U.S. banks on Monday in New York. Bankers say they anticipate that Brazil's central bank president, Carlos Geraldo Langoni, will ask for an easier repayment schedule on its existing debt. So far, Brazil has denied that it will ask for a rescheduling, but now it may have no alternative, bankers said.

The Brazilian situation has developed into a day-to-day cash squeeze, keeping world financial markets on edge. So far, however, Brazilian banks have not missed payments on any international obligations, although they needed a stop-gap advance of $1.23 billion from the United States, announced two weeks ago by President Reagan during his trip to Brazil.

Private bankers say that the first disbursement of the loan actually had been made in October and that Brazil already has drawn down nearly all, if not all, of the dollars. As a result, Brazil has been searching for still more "bridging" money to tide it over until the IMF rescue mission is completed.

Markets are anxious not only about the Mexican and Brazilian situations, but about the continuing uncertainty over the richer nations' plans for increasing the IMF's resources.

While agreeing that it is urgent for Third World countries to get emergency help, Williamson said that "the puzzle is not so much short-term-loan needs, as providing the environment that will give these countries the chance to expand their exports." Exports provide the countries with the foreign currencies they need to repay foreign debts.

Officials have denied reports that the United States had granted Brazil a new loan beyond the $1.23 billion already announced.However, it was confirmed that the United States and several European nations are holding additional discussions about more temporary advances that might be offered to Brazil through the Bank for International Settlements until the IMF loan package is confirmed.

One source said the proposed BIS package would total $1.8 billion, in cluding the $1.23 billion that the United States already has given Brazil, and about $600 million from the central banks of West Germany, England and France. The Bank for International Settlements, based in Geneva, coordinates activities of European central banks.

Meanwhile, the IMF is trying to put the finishing touches on a $3.8 billion loan to Mexico. The IMF agreement with Mexico would require commercial banks to resume substantial lending to Mexico, with the IMF counting on the banks to supply $6.5 million -- $1.5 billion to cover current obligations and $5 billion in new cash. Mexico, like Brazil, has external debts of $80 billion or so.

The banks involved in the proposed Mexican credit are supposed to tell the "agent" bank for the loan -- Citibank -- by today whether they intend to sign on for the new credit on which the IMF credit is contingent.

Dennis Wright, chief of Latin American lending for Continental Illinois National Bank of Chicago, acknowledged there might be some problems with smaller banks -- all told there are close to 1,000 banks involved -- but not with the 114 big banks that hold some 85 percent of the Mexican debt.