In its halcyon days, Wapora Inc. had a staff of 200 and churned out environmental impact statements as fast as it could win another contract from the Environmental Protection Agency.

But those days are only a memory now for the small Chevy Chase company. EPA has sharply curtailed its contracting, Wapora's staff has been slashed to 100 and earlier this year the firm reported its first loss in a decade.

"It wasn't a dip," said Wapora president Jacob I. Bregman, "it was falling off a cliff."

A short distance away in Silver Spring, however, ORI Inc. has added 50 employes in the last year, increasing its staff to 525. The difference is that ORI, started in the Korean War era to do weapons research, still focuses on such defense work as ship controls for the Trident submarine.

Wapora and ORI represent the mixed impact the Reagan administration has had on the so-called "Beltway Bandits," the estimated 200 consulting and professional services firms in the Washington area whose principal client in one form or another is the federal government.

Spawned by the enormous growth of federal spending in the '60s and '70s, the firms earned a reputation as a fourth branch of government and, with 20,000 employes, became a major factor in the Washington area economy. But starting with the Carter administration, which began cutting back on the number of consulting contracts, the industry has faced an uncertain future.

The Reagan budget cuts have sharply curtailed social service programs and spending on other nondefense items, and funds for research in those areas have been slashed in the process. At the same time, the administration has poured money into bigger budgets for the Pentagon, and spending for defense research has jumped.

The result is that relatively small companies like Wapora whose livelihood depended on contracts to research energy, environmental, educational and various social issues have had their old lifelines cut, forcing them to lay off hundreds of workers and explore ways of breaking into the lucrative defense field. Meanwhile, larger companies like ORI with long histories of defense research and consulting say they are not only holding their own, but in many cases expanding.

Figures compiled by the Office of Management and Budget show the significance of the shift toward defense consulting. The government spent $785.5 million on consulting and related services for the Defense Department last year, compared with $771.3 million for all other departments and agencies. For the year starting in October, however, the Reagan administration expects to spend $893.8 million on defense consulting and $715.3 million on all other similar work.

That is a 13.8 percent increase for defense in two years and a 7.3 percent cut for all other agencies. Factoring in inflation, spending for defense consulting will drop by 1.2 percent and expenditures for consulting at all other agencies will plummet by 19.5 percent.

The 1983 total of $1.6 billion for consulting, research and studies is, in fact, far below the industry's glory year of 1980, when the federal government spent $3.8 billion. President Carter subsequently ordered a 20 percent cut in federal spending for such services, President Reagan directed that another 5 percent be cut and Reagan budget cuts in individual agencies forced still further reductions.

"Reaganomics are becoming real," said Mike McCullough, president of the Professional Services Council, a trade group of 70 research and consulting firms, and the head of the Washington office of Booz-Allen & Hamilton, the giant management consulting firm. "Professional services are used mostly at the start of federal programs. When there are no new starts, that's where you see no new business."

Despite the shrunken federal pie for consulting, McCullough said that "everything that has been said by the administration has been favorable to the private sector" and to the hiring of consultants to do research and studies that the government either does not have the expertise to do or that can be done cheaper by outside help.

Don Sowle, the administrator of OMB's Office of Federal Procurement Policy, said the administration believes "consultants are a legitimate method to get certain kinds of work done." But he also noted that "in the long haul, if there are lower budgets, then there will be fewer consultants."

As government consultants fight for the available dollars, they also are trying to protect their flank on Capitol Hill.

Some lawmakers have waged war for the last two years on abuses in the hiring of consultants and on the quality of their work, while other legislators with large contingents of civilian military workers in their states and congressional districts have sought to limit the Defense Department's use of private firms to perform tasks--such as the fire and security functions at military bases--that are now being done by government employes.

Such limitations on the use of private companies do not directly impinge on the hiring of professional service firms, but they nonetheless are worried that restrictions on them could be next.

The Senate voted recently to prohibit the Pentagon from contracting for fire and security services on military bases in 1983, while the House Armed Services Committee has voted for a one-year moratorium on defense studies of whether to hire private contractors to do various jobs now done by government workers.

While the Capitol Hill battles are being fought, many consultants in the area are more concerned about where their next contract is coming from.

Stephen Stollmack, president of Analogs Inc., a small health and social sciences research firm, said his firm is completing work on its latest contract and that he has cut the staff from a high of 17 in 1979 to a single half-time worker.

"It's a very dismal situation," said the 47-year-old operations researcher. "We just ran out of work. I just come in to keep things open.

"We're in a position to help the efficiency of some of these programs and the agencies don't have any money," Stollmack said.

He said his prospects for more government work are not promising. "It costs anywhere from $2,000 to $10,000 to write a good proposal," he said. "I don't have that kind of money."

Still, Stollmack said he is not ready to quit. "I don't roll over and play dead," he said. "This is my life."

Other companies said the budget cuts are taking their toll at the same time Reagan administration officials are often taking months longer than previous administrations to award contracts.

Laura Henderson, president of Prospect Associates, a 3 1/2-year-old Potomac firm specializing in health care issues, said that contracts that once took three months to award now take six to nine months. She said her firm's revenues could drop from $1.5 million in 1981 to $1 million this year.

"We're hurting, but not as much as others," she said. "Had we been in education, we'd probably be out of business right now. The smaller firms are really being hurt by this recession. Maybe they only have one or two contracts and that might be the contract the government says to cut."

A.L. Nellum, president of the consulting firm that bears his name, said that his company, a black-owned firm, has experienced particular difficulty with the Reagan administration.

Half his firm's $4.5 million to $5 million in expected business this year falls under the Small Business Administration's set-aside program that designates certain government contracts for socially and economically disadvantaged people. But the current administration, unlike previous ones, has sought to limit use of such contracts to companies with less than $2 million in annual business.

Because Nellum's firm exceeded that figure, its contract renewals have undergone special scrutiny. "We have had to wait 12 months for a contract renewal for work we were already doing for the last two years ," he said. In the intervening time, Nellum said, "we were unable to do anything because we had no contract."

Meanwhile, he has trimmed the size of his staff, from 200 in 1979 to 120.

Some larger firms have also had to retrench. Westat, a 21-year-old Rockville survey firm specializing in health care, energy, transportation and other issues, had had increasing revenues during its entire existence, until last year, when it dropped from nearly $19 million in 1980 to $15 million.

"No company can continue to grow at the rate we had for the last 20 years," said Westat's chairman, Edward C. Bryant. "All companies have to mature."

Gary Jonas, president of University Research Corp., said his firm's revenues will likely drop from $8.7 million last year to about $7 million this year. He said his staff, which, among other things, manages large government training programs, has been pared from 150 to 120 as the government has declined to exercise options to extend contracts that the company had won.

For the public, such an action generally means that their tax dollars are being saved. But it also means that a particular program or service is no longer available.

In one such instance, University Research was operating the National Center for Alcohol Education, under which it trained state and local government workers in how to deal with the alcohol problems of people in their communities. But the program will end in September, nine months before its scheduled expiration.

"The shortsightedness of this is that now there's no federal program that would be a focus for alcoholism services," Jonas said.

Jonas said his firm is now seeking defense contracts. "We're very pragmatic," he said. "There are programs in the military that are very related to what we've done."

While social science firms such as University Research have trimmed their operations, defense-oriented firms think they are well-positioned for the Reagan years.

Booz-Allen's McCullough said his firm is increasing its defense work from about 70 percent of its $50 million worth of federal contracts last year to about 75 percent of its expected $55 million to $60 million in government billings this year.

At Planning Research Corp. in McLean, another of the giants in the consulting business, officials expect that as their aerospace contracts are completed, defense work will more than offset the losses.

"We will go after more defense contracts," said George Monroe, a PRC vice president. "Those contracts will be huge competitions. All the best companies will be after them.

"We see a good future in defense," Monroe said. "We think our business looks good."