RIGA, U.S.S.R., JAN. 8 -- Latvia's legislature today defied a threatened Kremlin crackdown on draft evaders by warning Latvian government officials against "collaboration" with Soviet military authorities and encouraging would-be conscripts to go underground.

The toughly worded resolution condemning the beginning of a new Soviet "invasion" of the three Baltic republics placed Latvia on a collision course with Moscow over the Kremlin's determination to enforce conscription regulations. The Soviet army has given the Latvian government until Sunday to begin rounding up draft resisters and deserters voluntarily to forestall action by Soviet paratroops.

In an interview today, Latvian President Anatolijs Gorbunovs described the Soviet move as a "step toward" the imposition of direct presidential rule in Latvia and the neighboring republics of Estonia and Lithuania. He said Soviet President Mikhail Gorbachev was using the conscription issue as a test case to see if he could reimpose his authority over the three republics, all of which last year formerly proclaimed the restoration of their pre-World War II independence.

"If we fulfill this latest decree, there will be more decrees in the future. A conflict is inevitable sooner or later," said Gorbunovs, one of several former senior Latvian Communist officials who have climbed aboard the independence bandwagon.

All three Baltic republics have rejected Moscow's latest ultimatum with varying degrees of public defiance. In Lithuania, which has adopted the most uncompromising line toward Moscow, the Soviet army staged a show of force early this morning on the streets of Vilnius, the capital. Witnesses counted 51 light paratroop tanks, seven armored personnel carriers and 32 troop trucks rumbling past the legislature building and on to a military base near the city limits.

Here in Riga, an important military base for the Soviet Baltic fleet, no troop reinforcements have yet been observed. But Gorbunovs predicted that, barring some unforeseen development, special paratroop units will soon be dispatched to every city and town in the republic to help local military authorities round up Latvians who have deserted the Soviet army or failed to report for conscription.

In its resolution today, the Latvian legislature instructed "all enterprises, organizations, officials and inhabitants of Latvia" to refrain from "any collaboration" with the Soviet army in the "forcible conscription of Latvia's inhabitants into the Soviet armed forces." It also said that Latvian citizens performing alternative service in lieu of military duty would be excused if they did not show up for work, a clear invitation for them to go into hiding rather than surrender to the army.

Like the other Baltic republics, Latvia has adopted a law allowing its citizens to perform alternative service if they object to serving in the Soviet army. But last month Gorbachev issued a decree calling the Baltic laws invalid.

"The one possible compromise would be for the Soviet authorities to recognize the right of citizens to perform alternative service," said Gorbunovs. "But unfortunately, Gorbachev does not seem to have a program other than ruling the state by unilateral methods. This has brought us to the present crisis."

According to the Latvian legislature, about 10,000 Latvian residents failed to report to Soviet draft boards last year. Most of them reported to Latvian authorities for alternative service, in institutions such as the Latvian police, but about 2,000 young men failed to report at all.

"There is a slight chance that we will be able to persuade the Soviets to show leniency to those who reported for alternative service. But it's going to be very difficult for us to defend young men who have defied both Soviet and Latvian law," said Edvins Inkens, a Latvian legislator and television commentator.

Political tension in this Baltic seaport has been rising steadily for the past few weeks as the quarrel between the nationalist governments of the Baltic republics and the Kremlin has moved toward a climax. The new round of jitters began with a series of mysterious nighttime explosions outside Communist Party offices and military barracks that many Latvian politicians denounced as Soviet "provocations" designed to create the climate for a crackdown.

Last week, crack Soviet internal security troops known as "Black Berets" took over the republic's largest publishing plant on the pretext that it had been illegally expropriated from the Latvian Communist Party. Journalists and printers responded with a strike.

"This is all being done to create a pretext for military rule. It's a campaign to create a tense situation so that in the end there will seem no alternative to a military takeover," said Alvars Enezins, chairman of Latvia's legislative commission.

The tension has been compounded by controversy over the government's economic austerity policy. At the beginning of the year, Latvia followed Estonia in sharply reducing subsidies on basic foods, including meat and dairy products. The Communist opposition has seized on the resulting price rises to drum up anti-government feeling among factory workers, many of whom are ethnic Russians.

Latvian Prime Minister Ivans Godmanis went on television tonight to appeal to workers for patience, promising that they would be compensated for the price rises. He was followed by the Soviet deputy military commander here, who called on young Latvians to report voluntarily to draft boards by the weekend to avoid punishment and offered to let them perform their military service in the Baltic region.

Despite the rising tension, Riga still seems a generally relaxed and cosmopolitan city to a visitor from Moscow. Thanks in part to the recent price rises, stores are relatively full, and people on the street display a sense of style that is almost completely absent in Moscow.