From the overcrowded and smoke-filled Capital Hilton suites early yesterday morning, word flowed that Treasury Secretary James Baker bested Geraldine Ferraro at the Gridiron Club's annual off-the-record meltdown.

Word also flowed faster than the expensive scotch that two of President Reagan's punch lines did not sit well with some of the guests, in fact eliciting a chorus of groans followed by a deadening silence.

In speaking of the farm issue, dinner guests said later, Reagan quipped, "I think we should keep the grain and export the farmers."

The joke fell flatter than a bad wheat crop.

"I didn't think it was funny, and I didn't laugh," said Sen. Larry Pressler (R-S.D.), who represents a key farm state, after the dinner.

Nebraska Democratic Gov. Robert Kerrey also appeared unhappy with the remark, according to those sitting near him.

A few minutes later, guests reported, Reagan talked about "rumors" that he was seeing a therapist "three times a week," advising the audience not to worry.

Then he explained to the crowd that he just had a "problem" with pushing buttons.

That one fell flat too, the guests said later.

The president's remarks became the prime topic of post-party chatter. Fresh in people's minds, perhaps, was Reagan's controversial joke about bombing the Russians, made last August before one of his weekly radio addresses.

Yesterday the White House declined to comment, and would not reveal who wrote the president's remarks.

But for Baker, the evening couldn't have been a better forum for his comic debut as more than 600 of the nation's powers and power lovers sandwiched into the Capital Hilton's ballroom to celebrate the 100th anniversary of the media club that has become synonymous with satire and exclusivity.

The Gridiron Club dinner is an annual singeing of Washington officialdom by the journalists who cover it. The white-tie, six-course, six-hour event is also the organization's sole reason for being. And lest the powers that be remain defenseless, the club always invites a representative from each political party to face off.

Baker stole the show. Some of his best, from the usual reliable sources who were inside:

* "Speaking of people 'low down on the list,' the vice president is here tonight. But we should all be proud of George Bush. George did so well at the first Soviet funeral that they keep calling him back. In fact, his motto is 'You die -- I fly.' "

* "There are a lot of well-known people at the head table tonight. The president is here, the chief justice is here, the secretary of state is here . . . [looks under the table and returns to mike] John Riggins is here?"

* "I really want to congratulate Gerry Ferraro. She's the only ex-politician in town not working for Bob Gray."

* "The president called me very excited the other night when he got back from Canada. He'd heard about the bank holiday in Ohio. He wanted to know if we all got the day off."

Ferraro, too, got good reviews -- although her two joke writers couldn't top Baker's eight. Joking about her controversial Diet Pepsi endorsement, she quipped, "To tell you the truth, I really wanted to endorse diet Perrier, but the Perrier people said George Bush or nobody."

Some other moments to remember:

* White House deputy chief of staff Michael Deaver sat stone-faced during five cutting references, scattered throughout the night, to his BMW acquisition.

* Soviet Ambassador Anatoliy Dobrynin did not show up, leaving his chair next to Ferraro empty.

* "I got some good news from Geneva," Reagan told his audience. " 'Nancy, your watch is ready.' " And then, after describing the tedium of his job, the president said that to break the monotony, "every few days, I call CBS and ask for Jesse Helms."

* The club's skit about military procurement brought down the house when a gaggle of journalists showed up on stage in cone-head costumes with gold-glittered toilet seats hanging from their necks. To the tune of "I Found a Million Dollar Baby in a Five-and-Ten-Cent Store," they sang:

We buy our toilet seats at Tif-ny's

We drive Mercedes by the score,

They found a million-dollar hammer

In a five-and-ten cent store.

* John Zaccaro and Supreme Court Justice Sandra Day O'Connor sat eyeball to eyeball, engaging in animated conversation all evening.

* Retired general William C. Westmoreland got more applause than Walter Cronkite.

* One crisis of the night for guests was whether to eat the silver "paper" that covered the cold consomme'. It was edible, but it nonetheless caused some confusion.

It should also be noted that the menu was changed from hot soup to cold soup on Thursday when, according to a Hilton spokesman, the hotel was notified that the president wanted to be back at the White House by midnight. Having the consomme' on the table shortened the program a full 20 minutes.

* Actor Robert Duvall was on hand for his third Gridiron dinner. His favorite, he said, was the one he attended 13 years ago when Sen. Barry Goldwater (R-Ariz.) faced off with Hubert Humphrey.

Over the past century, the 60-member club of longtime Washington journalists has lampooned every president, developing a sophisticated routine of skits, songs and jokes aimed at tweaking the establishment. This year the club performed a history of songs from the past 100 dinners, like the one teasing William Howard Taft for his large appetite:

Sound the good old dinner horn, we'll sing another song

About the trip that Taft once made when with digestion strong,

He ate his share of everything that they would bring along,

As he went eating through Georgia.

The working press is never invited to the dinner, and the editors, reporters and publishers who are guests are expected not to report on it. Still, "off the record" has come to have no value at this dinner. Everything comes out eventually.

Though a merry time is had by all, critics of the dinner use it to spotlight the oftentimes incestuous relationship between the media and its sources.

Saturday night, they dined on trout and lamb and boasted a guest list that included President and Mrs. Reagan, Vice President and Mrs. Bush, Secretary of State George Shultz, Defense Secretary Caspar Weinberger, Chief Justice Warren Burger and four associate justices, Chrysler Chairman Lee Iacocca, the Rev. Jesse Jackson, feminist Betty Friedan, Olympic Gold Medal winner Edwin Moses, Mayor Marion Barry, Sen. Gary Hart (D-Colo.) and Rep. Jack Kemp (R-N.Y.).

In introducing some of the guests, emcee Lucien Warren of the Frederick News-Post started off the night sniping. Take these examples:

On Lee Iacocca: "General Motors and Ford Motor Company are worried about the new seat belt safety rules. But Chrysler doesn't have to worry about it. They already have their own air bag."

On White House counsel Fred Fielding: "The ethical arbitrator of the White House, who learned everything he knows from the Nixon White House. He never met a man he would indict."

To respond to the Gridiron's roasting, Ferraro made her first major Washington appearance since the November election, and Baker made his first speech since leaving the White House to become treasury secretary.

Some of Ferraro's lines, penned by ghostwriters Frank Mankiewicz, an executive vice president at Gray and Co., and Dick Drayne, a CBS vice president:

* "It appears that over the next five years there will be nearly 20 votes on 'Star Wars' in the House. Twenty votes! Can you imagine? That's 40 different positions for Les Aspin to take.

* "I see the president has relented on emergency relief to the farmers. He's opened a special line of credit for them to be drawn on any Ohio savings and loan."

For his remarks, Baker commissioned top Republican joke writers including Don Penny, Vic Gold and Dick Moore.

By all accounts Baker's largest laugh-getter was the following joke:

"I had a terrible dream last night. I dreamed the three most powerful Americans -- the president, the speaker of the House and the chairman of the Federal Reserve -- suddenly passed away. All three appeared in St. Peter's waiting room.

"A voice came over the intercom telling the president to go to Room One. He went inside and found himself with a huge gorilla. The voice then said, 'Ronald Reagan, you have sinned, and you must spend eternity with this gorilla.'

"The voice over the intercom then sent Tip O'Neill to Room Two, where the speaker found a mad dog. 'Mr. Speaker,' the voice on the intercom said, 'you have sinned and must spend eternity with this mad dog.'

"Then the voice sent Paul Volcker to Room Three. He went in, and to his surprise he found himself with Bo Derek. Then the voice came over the intercom and said, 'Bo Derek, you have sinned . . .' "

The crowd went nuts.

Said Sen. Daniel Patrick Moynihan (D-N.Y.) after the dinner: "Mr. Baker may have been funnier, but Mrs. Ferraro was much more moving. They were all genuinely happy to see her."

"I think she was gutsy to get up there," said Vermont's Democratic Gov. Madeleine Kunin.

"Well, I think Baker was better," said New Jersey Gov. Thomas Kean. "But then again, I'm a Republican."

The Gridiron members also performed songs for Baker and Ferraro, whereby journalists sang in the first person, as if they were Baker and Ferraro.

Ferraro's song, performed by UPI's Helen Thomas, went like this:

Now that I've got payola,

Pushing Pepsi-Cola,

I'm full of beans,

I'm Gerry from Queens.

The chorus of Baker's song, to the tune of "When I'm Not Near the Girl I Love," was:

First with Ford and then the preppie

I ignited Reagan fear

When I'm not near the pol I love

I love the pol I'm near.

Over the past four years, the president and Nancy Reagan have twice surprised their audiences at the Gridiron. Two years ago Reagan danced out on stage at the end of a conga line, clad in a huge sombrero and flashy serape, and sang his own version of "Man ana." Three years ago, Nancy Reagan brought the house down when she turned up wearing pantaloons and sang "Second-Hand Rose." This year the White House backed away from any spectacular performance by the Reagans, according to a club official.

In the end, Baker turned serious in saluting the Gridiron on its centennial.

"Members of the Gridiron, we've been through a lot of campaigns together," he said. "With bad motels, bad food, no food, late nights and early morning baggage calls. We've also had our share of mutual misunderstandings and irritations. I'd like to think that when we disagreed, we disagreed agreeably.

"We should all treasure the fact that we live in country where public figures and free press have for over a century been able to get together and laugh, both with and at each other."

The applause was thunderous, and the crowd filed out into the wet, rainy night.