Peter J. Gianaris, 64, for a many years the king of Washington bookmakers, a gambler whose clients have included rich and famous lawyers, doctors, journalists and businessmen, stood before a judge for sentencing yesterday, the seventh time since 1938.

The government prosecutor portrayed Gianaris as a "classic recidivist" who operated a substantial sports betting ring here in 1975 and early 1976 while on probation for an earlier offense. Gianaris was asking for probation again, but the government said he should not be permitted to "thumb his nose at the court."

At the end of an unusual two-hour hearing, U.S. District Court judge Charles R. Richey sentenced Gianaris to five years in jail but suspended all but six months of the prison term. Richey also ordered the gambling figure to spend 200 hours working in the community and to pay a $10,000 fine.

The judge's sentence came after Gianaris' attorneys submitted a 33-page memorandum, which contained segments of letters written by lawyers, sportswriters, an official of the Boys Club of Greater Washington, a funeral director and produce man who once worked at Union Station. The letters described Gianaris as having "a heart of gold" and as a man of great charity, intergrity and fairness.

One letter recalled a visit 25 years ago to a local orphanage, where the children knew Gianaris as "Peter Rabbit . . . obviously reciprocating his warmth and attention and love for them."

Another told now Gianaris lunched and dined with a poor aged Greek immigrant, "a forgotten man without a family." When the man died a year ago, it was Gianaris who made sure that the man "had a decent funeral and burial."

". . . He is a man full of kindness and compassion for others who asks nothing in return," said the author of the letter, described only as a Washington lawyer who has known Gianaris for 37 years.

The government would not dispute Gianaris reputation for charity, Assistant U.S. Attorney Peter O. Muellers said. "Surely there is good and bad in all of us," he added, urging Judge Richey to impose some form of incarceration.

But Judge Richey also listened as defense attorney Roger E. Zuckerman recounted the high cost of imprisonment to the community what Gianaris had done was but "a nuisance offense," and urged that his client be sentenced to a long period of probation that would include some form of unpaid community service.

The gambling has been a "sickness," Gianaris told Richey, and he knew he had "been given a chance before" to change his ways. Now, he said, "I pray the court will give me a chance" to settle this case "by helping people really in need."

Zuckerman told Richey that since January, 1976, Gianaris has "refrained from any unlawful gambling" activity and it now operating a small commodity brokerage firm out of a flat at 3417 1/2 M St. NW, which also serves as Gianaris' residence.

As he was about to impose sentence, the judge said he did not intend to make "a speech" about the various philosophies of sentencing - deterence, rehabilitation, punishment. Instead, he simply acknowleged that he knew Gianaris was in ill health and that he now stood before the court "in disgrace."

With that, Richey ordered Gianaris to serve six months of five-year sentence in prison, with the remainder of the term suspended. When he is released from jaiil, Gianaris will serve five years of probation, Richey said, and must spend 200 hours in community service at St. Elizabeths Hospital, the city's facility for the mentally ill.

The judge ordered that Gianaris be jailed immediately until the $10,000 fine was paid or a bondsman was found to insure its payment. Within three hours, a bond was secured and Gianaris was released from the courthouse cellblock, where he was taken immediately after the sentence was imposed.

"I think it was fair, I'm glad it's over with," Gianaris said, as he left the courthouse with Zuckerman and another of his defense attorneys, James L. Lyons.

Specifically, Gianaris and his brother Nicholas were convicted by Richey last October of conducting an illegal gambling business. The conviction followed a proceeding called a "stipulated trial" during which Gianaris confirmed the facts of the government's case but maintained his right to appeal the conviction on specific legal issues.While his appeal is outstanding, Gianaris remains free on his personal recognizance.

In a detailed statement of the facts of the case, the government said the Gianaris brothers operated a gambling ring in which thousands of dollars a week were bet on basketball and football games by telephone.

Sources close to the investigation said yesterday that between Dec. 31, 1975, and Jan. 18, 1976 - during which time the government wiretapped the operation - an average of about $100,000 in bets a week were placed with the Gianarises on various sports events.

In presenting the case to Richey, the government did not disclose the names of any of the bettors, after attorneys for some of the bettors requested that the names of their clients be removed from public court records. So, instead, the bettors were identified only by numbers.

Yesterday, in a related development, a Ralph Nader-consumer interest group called Fight to Advance the Nation's Sports, filed a request under the federal Freedom of Information Act requesting the court to compel the prosecutor's office to disclose the bettors names.

The group made the request because "we're sort of curious as to who the people are," an attorney associated with the organization said. In its facts of the case, the government said bets were placed with the Gianaris brothers on behalf of a former congressman.

Judge Richey sentenced Nicholas Gianaris, 55, to serve six months in prison and 200 hours of community service. In addition, the judge fined him $5,000 and ordered him jailed until the fine was paid or bond secured

Five other men, also convicted of gambling charges in connection with the Gianaris operation, were also sentenced by Richey yesterday to various prison terms, periods of community service and fined for their activities.