Sir Huw Wheldon, retired chief executive of the British Broadcasting Corp., reared back in his chair, still more or less upright, and stated the principles on which he undertakes his labors:

"For piety, for glory, or for cash," he said.

He did not say which was the controlling virtue behind his new TV show, "The Library of Congress," which airs tonight at 9 on Channel 26. "Dredful title, isn't it?" he said. "If people tune in, then I'm not so worried. I think the work is good, and people will find the subject more fascinating than they think. The trick is to get them to tune in in the first place. Who wants to see something called "Library of Congress?"

daniel Boorstin, the librarian of Congree, had stood politely by, but now ventured a commemnt:

"I don't see what the problem is, I think it's a beautiful title."

There's one in e very crowd.

Sir Huw sat about 18 of us down in a cubbyhole along Mahogany Row in the Library of Congress and announced we would enjoy the program, he hoped, and he would return when it was over.

"You did't wit through it yourself, did you?" he was asked.

"Surely you could not expect me to? After all, I wrote it, narrated it, and have presented it on British television-the British are quite fascinated with it-but there comes a point you have seen it enough."

The little room of the showing was the size of a den, the sort of room old gentlemen used to retire to alone at 5p.m. to have a today. The cornice is composed of about 84 moldings, including an ovolo finished in brilliant gold leaf, and there are touches of green and so on-an incredible mishmash lovingly restored and gilded in recent times, and this prepared the viewer for the opinion (voiced by both Boorstin and Wheldon) that the library is architecturally "beautiful9"

It has come to that. In a city full Victorian frippery and gewgaws, the library has gewed the most gaws and now is pronounced "beautiful."

There was a time it would have been hideous.

And this brings us to a hard, hard fact:

"The library acquired 7,000 new volumes a day," Sir Huw said (Boorstin assenting proudly).

"I have been chairman of the London School of Economics," Wheldon went on, "and we moved the library. An incredible undertaking. That got my mind to running along library lines," and first thing you know, here is the great documentary.

"Now I well recall the fire in part of the British Broadcasting Corporation films. A terrible loss, and I remember the feeling of liberation, all the same."

"Do you suppose," he was asked, "the felt free and uplifted when the library of Alexandria burned?"

"Must have," said the cheerful Welshman. "Must have."

And he spoke of the sense of burden-at least for literate people of mature years, of whom there are probably not many now alive in the world-the burden of the enormous knowledge of the centuries all stored up.

"The trouble is," he said, a bit more seriously, "the fire may burn up just the wrong things. And look at the history of enthusiasms-how can we know what will be valuable and what won't?"

"There may be things in libraries-look at Mendel-we aren't ready to take seriously, but which someday will be taken seriously," someone suggested.

"Yes," said Sir Huw. "Look at the shifts in literary taste. Since the 17th century."

"Still," someone went on,"7,000 a day. Do you think our poor republic can afford to keep up with such a glut?"

"I know the feeling, but you are not really a poor republic, you know. The Library of Congress has taken over from the British Museum to collect and preserve all books on all subjects in all longuages.

"If you are not the curator of all this, who else will be?

"It would be nice, I suppose if it were possible for acommittee to say, 'Well, this one is not worth keeping.' I suppose many are not worth keeping, in a sense.

"But your man Boorstin seems to me quite right when he says 'The only answer to excess is access.' That's rater catchy, isn't it? And true. Only by keeping it all can you be sure you are keeping the right things."

Sir Huw, as he talks, gradually sinks lower in his chair, so that his head is not all that much higher than his knees, but it is tought he has never actually fallen out of his chair or required help to get back up.

Some library types mentioned work of the library not covered in the show-its inter-library loan service, for example, or its service in Braille to the blind. But Sir Huw has the mediologist's answer:

"Such fine segments on all that, we had so many things it hurt to cut out. But 90 minutes is 90 minutes, and in a great institution like the library you can't tend to absolutely everything."

(Well. HE may think that's an answer. Some did not. Especially, one suspected, the inter-library people.)

The lighting of the pastel-colored marbles of the great lobby is only one of many starting things in the show. Perhaps no human ever saw the lobby so beautiful as the camera shows it.

Or maybe, ungrateful slobs that we are, we take the great library so much for granted we have forgotten to be thankful. A year of dependency on bookmobiles would probably straighten everybody out. CAPTION: Picture, Sir Huw Wheldon, By Douglas Chevalier