Consumer prices rose a moderate 0.4 per cent in December, held down by a small, 0.1 per cent increase in grocery store costs, the Department of Labor reported yesterday.

The cost-of-living report coincided with the announcement of President Carter's anti-inflation program, essentially a voluntary effort at wage-price restraint, aimed at the major industries and unions.

In his State of the Union address Thursday, Carter asked unions and industry to work to hold price and wage increased below those of 1977.

Although the program has no enforcement power, officials are hopeful that it can keep inflation from accelerating. Despite the relatively slow rate of inflation in December - the cost-of-living increase works out to a compound annual rate of 4.9 per cent consumer prices increased much faster in 1977 than in 1976. If the economy continues to improve further inflation pressures will be generated.

In the Washington area, food prices did not rise at all in December. Food prices were the only consumer prices measured in Washington last month. Over the year Washington food prices - both in grocery stores and restaurants - increased 8.4 per cent compared with an 8 per cent rise in the nation as a whole.

Washington food prices are not adjusted for seasonal variations.

After a moderate 4.8 per cent rise in 1976 - the smallest since 1972 - consumer prices accelerated last year. Between December 1976 and December 1977, the cost of living rose 6.8 per cent. Part of that increase was due to transportation problems and crop damage in last year's severe winter.

While better weather and good crops are expected to help hold down food prices in 1978, a number of factors will push consumer prices in the upward direction, including higher social security taxes, big crop price supports, new energy taxes and a higher minimum wage.

Administration economists hope to keep consumer price increases in the 6 to 6.5 per cent range in 1978, where they have been stuck for the better part of the last several years.

This so-called underlying rate of inflation represents the difference between wage increases, averaging about 8 per cent a year, and increass in output per hour worked, which has been rising about 2 per cent a year.

Even though food prices rose little in December, the Labor Department's wholesale price report earlier this month indicated that a big, although probably temporary, jump in food prices can be expected during the next few months.

While grocery store prices rose 0.1 per cent last month, prices of other commodities such as clothing and furniture rose 0.5 per cent. That is about the same as in November, but much higher than the 0.2 per cent average between June and October.

Prices of services, such as medical care and electricity, also increased 0.5 per cent, about the rate they have been rising since August, but lower than earlier in the year.

The purchasing power of the average hour worked by an American remained unchanged between November and December and was 0.6 per cent higher than in December, 1976.

The Labor Department said there were big decreases in the price of eggs in December as well as in poultry, dairy products and coffee. Beef and pork prices moved up, as did fresh vegetables. Restaurant prices increased 0.4 per cent.

Most of the increase in non-food commodities was in new cars and home funishings. Smaller increases were recorded for gasoline and clothing, while fuel oil prices fell 0.1 per cent.

Medical care prices climbed 0.7 per cent, while transportation prices gained 0.4 per cent. Gas and electricity prices declined for the second consecutive month.

The consumer price index measures the change in prices of about 400 goods and servces thought to represent the purchases of an average urban worker who heads a family of four. The index will substantially revised and updated next month.

The index stood at 186.1 per cent of its 1967 average, which means that a selection of goods and services that cost $10 in 1967 cost $18.61 last month. All percentage changes are adjusted for seasonal variations, although the index itself is not.