Consumer prices rose last month at their slowest rate this year, and grocery-store prices actually fell a little, the Labor Department reported yesterday.

But the day's inflation news was mixed; many of the nation's largest banks announced yesterday that they were raising their prime interest rates, the rates they charge their best corporate customers for short-term loans, from 6.75 to 7 per cent. (Details on Page C8.)

Meanwhile, in another report reflecting the pickup in the economy this year, the Commerce Department said that corporate profits broke out of a six-month slump in the second quarter of this yeart and rose 11 per cent over the quarter before.

Profits last quarter ran at an annual rate of $139.7 billion, as against $125.4 billion the first three months of the year. That first-quarter rate was below last year's average; profits the first quarter were depressed as cold weather and fuel shortages ate into sales and production.

Consumer prices rose 0.4 per cent in July, after moving up 0.6 per cent in May and June and 0.8 per cent in APril. The good news seemed to support the contention of administration economists and others that the rate of inflation will decline in the second half of the year.

The consumer price index rose at an annual rate of 9 per cent in the first half of the year.

Labor Secretary Ray Marshall called the lates consumer price index "encouraging" but noted that continuing increases in the services sector - such as medical care, transportation and utilities - are "troublesome."

The report from Marshall's department said wage rates rose faster than prices last month, so that there was an 0.2 per cent increase in the buying power of an average hour's work.

While grocery-store prices declined 0.1 per cent in July - after rising sharply in the six previous months - services rose 0.8 per cent, about the 10 per cent annual rate at which they have been rising all year.

The Labor Department cited lower prices for "beef, poultry, pork, fresh fruits and vegetables, sugar and ground coffee." It was the first decline in coffee prices in almost two years, the agency said.

Food prices, and to a lesser extent energy prices, have been the main reason the cost of living surged during the first part of 1977. Good harvests this year should result in continued moderation at the grocery store for the rest of the year.

While grocery-store prices declined in July, restaurant prices rose 0.4 per cent. But this rise was much less than during the first half of the year, the Labor Department said. Overall food prices - grocery store and restaurant - rose 0.1 per cent in July.

Non- food commodities, such as gasoline and clothing, also rose 0.1 per cent, after rising 0.2 per cent in June. The slowing of nonfood prices is due to "declines in used car and gasoling prices," the Labor Department said.

Normally gasoline prices rise during the summer when motorist use their cars the most, bu the nation has a surplus of gasoline this summer - some analysts say because the oil companies underestimated how much newer cars would cut gasoline consumption. Because of the surplus of gasoline major oil companies have trimmed prices this summer.

While gasoline prices fell 0.3 per cent in July fuel oil and coal prices rose 0.6 per cent, still their smallest monthly increase this year.

Gas and electricity prices and a rise in mortgage interest rates were the prime reasons services increased 0.8 per cent, the Labor Department said.

The consumer price index is based on a selection of 400 goods and services that is designed to reflect the average purchases of an urban family of four. The index stood at 182.6 per cent of its 1967 average last month, which services which cost $10.00 in 1967 cost $18.26 in July.

The index itself is not adjusted to relect normal seasonal variations, but all percentage changes reported by the Labor Department are seasonally adjusted.

While prices were rising swiftly in the first six months of the year, so was production and employment. The unemployment rate fell from 8 per cent in November to 6.9 per cent in July.

But the administration expects the economy to grow more slowly for the rest of the year, and most of the good economic news to come on the price, not the job, front.

The Commerce Department also reported yesterday that the economy grew rapidly in the second three months of the year, but not quite as fast as initially reported.

The agency said that it had revised its estimate of the growth of so-called real gross national product to a 6.1 per cent annual rate from the 6.4 per cent rate it estimated last month.