The united States posted a record $28.5 billion foreign trade deficit in 1978 -- $1.9 billion more than in the previous year and higher than some analysts expected.

The benchmark was reached when the December deficit totaled $2.04 billion, up from the $1.95 billion red-lik figure recorded in November, according to Commerce Department figures. Esport levels dropped moderately while imports held steady.

Although the December increase technically marked a worsening from the previous month's levels, analysts said they still expect the nation's trade picture to improve visibly later this year.

The deficit had been shrinking for much for last year, but grew slightly in November and December. Analysts said the surprisingly robust economic performance fo the fourth quarter -- which increased demand for imports -- may be to blame.

Shortly after the trade figures were published, Commerce Secretary Janita M. Kreps issued a statement predicting the trade deficit this year would be "substantially lower" than in 1978, even with an expected jump in oil imports.

U.S. officials have been predicting the trade deficit will drop to $25 billion or so in 1979, and some private analysts have forecast and even larger drop. The improvement depends in part on the shape of the U.S. economy.

Yesterday's figures showed exports fell moderately in December, dropping by $113.1 million, or 0.9 percent, to a new seasonally adjusted rate of $13.15 billion. In November, export levels had climbed 1.9 percent.

At the same time, imports slipped $18.3 million, or 0.1 percent, to a new seasonally adjusted rate of $15.19 billion. Imports had risen 0.5 percent in November and 0.1 percent in October.

Even with the December charges, exports still have been rising more rapidly than imports -- a trend that is expected to continue through 1979. The trade picture has been helped by the recent dollar decline.

December's deficit figure was held down in part by a moderate decline in oil imports, which fell 2.6 percent following a 2.3 percent rise the previous month. The petroleum figures have been erratic.

For 1978 as a whole U.S. purchases of foreign-produced oil totaled $39.5 billion, down from $42.4 billion in 1977. Moreover, the reduction came despite an increase in the price of crude.

In a separate report, the steel industry estimated that despite President Carter's new "trigger price" system for preventing foreign pirce-cutting, steel imports totaled 21.3 million tons in 1978, up from 19.3 million in 1977.

The most visible increases in imports last month occurred in foreign cars and foreign -produced food. Most other categories of imports were little changed from November's levels.

Exports of chemicals and chemical products declined over the month, but there were few other major changes in American shipments aborad.

December's foreign trade deficit was the 31st in a row. The $2.04 billion red-ink figure for December was calculated on the department's traditional basis. On a broader, worldwide system, the deficit was $3.03 billion.