Sen. Patrick J. Leahy (D-Vt.) said yesterday that he will ask District of Columbia officials to advise him how to cut at least $17 million-and possibly much more-out of the city's pending budget.

It is almost certain, Leahy said, that Congress will refuse to authorize an increase in the federal payment from its present legal limit of $300 million to the $317 million proposed by city officials and President Carter.

As a result, the city's proposed budget for the 1980 fiscal year is at least $17 million out of balance, Leahy said at a hearing of the Senate D.C. Appropriations Subcommittee, which he heads. The city is proposing to spend $1.4 billion on operations in 1980.

"If we were to reduce by $17 million, where would you suggest we do it?" Leahy asked Gladys Mack, the city's budget director, who was testifying. He did not press for an immediate response, and Mack said Mayor Marion Barry would 'want us to participate" in the budget-cutting decisions.

Other cuts in the budget may stem from last week's decision by the D.C. Court of Appeals that invalidated the tax collected since 1975 on the earnings of professionals who do business in the city.

If the city ultimately loses that case on further appeal, Leahy said, budget cuts would have to reflect the loss of the $14 million estimated annual yield from the tax, as well as 45 million in past collections that would be refunded.

Mack said all the money collected in past years has been spent, and if the city loses the case, it may seek to stretch the payment of refund over more than one year.

Leahy said it was clear from a meeting of the Senate dealing with the federal budget that lasted until after 1 a.m. yesterday that 'this is a Congress that is not going to be favorable to increasing budgets," including the extra $17 million sought by the District.

A House District subcommittee on Tuesday approved the proposed increase by a vote of 3 to 2. But Leahy predicted it would fail to win eventual approval by the full Congress. CAPTION: Picture, PATRICK LEAHY . . . $17 million, at least