President Pieter W. Botha, in a speech couched in imprecise language, hinted here tonight that he wanted to change South Africa's apartheid system of white-minority rule into a form of federation based on ethnic and geographic "units" that he said would cease to be discriminatory but would still require segregation.

Although vague, Botha's speech was the most comprehensive outline he has given of his intentions. It made clear that he is still thinking of a constitutional framework to grant each ethnic group autonomy over its "own affairs," with some mechanism for the groups to get together to discuss "general affairs."

Most representative black groups have made it clear that this formula, which requires continued racial separation, is unacceptable to them, and observers said tonight that Botha's speech would have little effect on the current racial violence in black townships throughout the country.

Botha said his government was "studying in depth" a recent recommendation by an official advisory group that laws restricting the movement of blacks to the cities, long regarded as fundamental to apartheid, should be scrapped. Proposals would be submitted to the Cabinet within the next few months, he said.

The president also announced that he was willing to consider reconstituting an advisory body called the President's Council to include blacks so that they could participate in negotiations for constitutional changes.

The exclusion of blacks from the President's Council has been a major issue of political contention since the advisory body was established five years ago.

Botha was speaking in the major city of eastern Cape Province, the principal site of the 14 months of racial violence that has now resulted in more than 700 deaths.

Rioting and bloody clashes with the police are a daily occurrence in the townships here, and in recent days the violence has shown signs of spilling over into white areas. A few hours before Botha delivered his speech, a white man was injured when a gasoline bomb was thrown into his automobile in the city of Uitenhage, 30 miles away.

Six other whites were injured in stoning and gasoline-bomb incidents in the region over the weekend.

White traders in the area also are being hurt by black consumer boycotts. Some had threatened to disrupt Botha's meeting tonight with demonstrations for the release of detained black leaders with whom they want to negotiate. No disruption occurred.

Local dissatisfaction with the government for its perceived mishandling of the crisis was evident in the small turnout for the president's address.

Botha had billed the speech, delivered to his own Cape provincial branch of the ruling National Party, as one that would contain an important reformist announcement. But the hall at a local university was barely half full and the mood of the crowd was somber.

The speech was filled with reformist rhetoric. "My party and I are committed to the principle of a united South Africa, one citizenship and universal franchise," he said. But then followed a number of qualifications that have become familiar to observers here. The system of universal franchise, Botha said, could not be "within structures prescribed from abroad," but would have to be tailored to suit the special circumstances here.

These circumstances were that the country did not simply have a black majority and a white minority; it was a society with a number of minority groups among the whites, mixed-race Coloreds, Asians and the various black tribes.

A system that tried to negate this group diversity through integration and the creation of one open community would not work as it implied a one-person-one-vote state that would mean "the dictatorship of the strongest black group." That would lead to "greater struggle and more bloodshed than we are experiencing today," Botha said.

Likewise, total geographic separation of the races was not possible, he added.

Attempts to maintain white domination over all the other minority groups would mean continuous confrontation.

"Between these extremes," said Botha, "there is a wide spectrum of views that recognize the existence of a diversity of nations and population groups." South Africans of all races would have to seek a solution within this spectrum through negotiation, he said.

The solution would need to "recognize the principle of self-determination of . . . community life such as education, residential areas and social welfare, local management and private ownership."

To those familiar with the government's political language, that means the system must be based on the different ethnic groups having autonomy over their own, separate residential, educational and community affairs.

"It is, however, important that from time to time in this country of minorities, we meet each other in political structures in order to discuss matters of mutual concern without the one group having the right to dominate the others," Botha said.

To achieve this, the president added, "units will have to be recognized on a geographical or group basis.

This obviously also includes the black urban communities who, for political purposes, are recognized as political entities.

"Each such unit should have autonomy on matters that only affect that unit, while the units on the central level should jointly manage matters of mutual concern."

This seemed to suggest that Botha has in mind a form of federation based on racial as well as geographical units, with urban black communities as well tribal "homelands" forming federal units together with the white, mixed-race and Asian communities.

Botha did not use the word federation, which has long been a key element in policies advocated by parties to the left of the government and strongly condemned by it. But his meaning seemed clear.

It is also clear from this and other speeches that Botha envisages control of matters affecting the country as a whole to remain in the hands of the white minority, which would also be in a position to elect the powerful executive president.

Botha has repeatedly excluded the possibility of the blacks having a fourth chamber of Parliament similar to those given recently to the Colored and Asian minorities.

The nearest Botha has come to conceding a role to the blacks in any parliamentary institution was the willingness he expressed tonight to consider including them in the 60-member President's Council.

In addition to its role as an advisory think tank, the white-dominated council also has a casting vote on bills that may be blocked in one of the three parliamentary chambers.

South African newspapers have been speculating that the council may be stripped of this legislative role if blacks are included in it. They think Botha wants to create a new constitutional court to exercise that function, making the council purely an advisory body.

Many observers see the Botha proposals as preserving the bedrock fundamentals of apartheid while giving blacks a kind of home rule over their own segregated community within the larger South Africa that whites will continue to run.

But Botha protested tonight that such interpretations are unfair. Apartheid, he said, had been turned into a "swear word," with the same emotional meaning as "imperialism" and "colonialism."

If by apartheid was meant race discrimination, political domination, the exclusion of any community from decision making, injustice and inequality, then his government was as much opposed to it as its critics were, Botha said.