Faced with the specter of not-too-distant severe food shortages, Nigeria is racing to duplicate nationwide the modest success of a pilot agricultural project here among Karazau District's tradition-bound peasants.

Most of black Africa is suffering from an alarming growth in food deficits, but Nigeria's problems are particularly acute. The country has a population of 100 million people, one-quarter of that on the continent.

Nigeria's planners also have been shaken by statistics indicating that the country's rate of population growth is higher than the African average--3.5 percent compared with 3 percent. In addition, Nigeria's rate of increase in food production is 1 percent, compared to the continent's average of 5 percent.

Once a food exporter, Nigeria now spends more than $2.3 billion annually on food imports. The dramatic turnabout in Nigeria's capacity to feed itself occurred with the overnight increase in oil prices in the mid-1970s that brought billions of dollars into the country, West Africa's main oil exporter, but also caused a neglect of agriculture.

Today, it is the same petroleum exports that hold out the chance of making Nigeria self-sufficient in food again. The government's ambitious $13.5 billion, five-year "green revolution" program to revitalize agriculture, however, could be jeopardized by the recent plunge in Nigeria's revenues and petroleum sales brought about by the world oil glut.

In the past decade, "when the country began to discover one oil deposit after another, the agricultural sector, hitherto our mainstay, has until recently continued to suffer outright neglect," said Nigerian President Shehu Shagari in a March speech. "The sharp increases in the oil prices in the world market from $2 in 1970 to $40 in 1980 led to large increases in government's revenues and the nation was soon lured into a false sense of security, forgetting the dangers of resting the fortunes of our economy on the development of a single sector--that is, oil."

The oil wealth caused expectations to soar, "and millions of Nigerians in the rural areas fled the countryside, abandoning the cultivation of land for the cities," said Shagari, referring to a major Africa-wide cause of declining food production. Little was done for the aging peasants who stayed on their farms and, for the most part, still use traditional, marginally productive farming methods.

Officials estimate that 97 percent of Nigeria's food comes from small peasant farms no larger than eight acres.

One such farmer is Karazau's magaji, or head man, Mande Karazau, 70. Until 1975, Karazau had been using the outdated but trusted farming techniques of his Hausa forebears. With three of the four wives the Moslem Koran allows him and 13 children, Karazau was able to maintain his domestic food needs and produce peanuts as a cash crop until drought hit the area in 1973.

To feed his family during the drought, Karazau had to sell his goats and sheep at the nearby town of Gusau, 13 miles west of here.

In 1975, the year the rains returned, Sokoto State and federal officials came into his district with a rural development project they claimed would help the farmers substantially increase their food and cash crop cultivation.

"Only four farmers, including myself, of 400 farmers participated in the project the first year," Karazau said. The farmers, Karazau continued, did not trust the new methods, and suspected the project officials were trying to confiscate their land when they began to build the get-to-market "feeder roads" to the Gusau highway and requested the farmers to put aside some of their land for demonstration plots.

Two dams were built on seasonal river beds and today provide year-round irrigation in this semiarid area. The four farmers who participated doubled their yields on their demonstration plots. "After that, everyone rushed to join the project," Karazau said. "Life has greatly improved for us."

The cost of the project, headquartered at Gusau, has been an expensive $500 million for Karazau and other nearby districts, according to Sokoto State's "green revolution" committee chairman, Yusuf Imam Wara. A third of the funds were provided by a World Bank loan, with the rest coming from the state and Nigerian federal government.

The fertilizers are subsidized 80 percent, a prohibitive expense for most African countries, a recent World Bank evaluation acknowledged. Overall crop increases were a respectable 5 percent.

The Nigerian government is now using the Gusau project and others like it as models for the nationwide "green revolution," but recent losses in billions of dollars in oil revenue could jeopardize the success of the effort. "For example, we distributed corn, millet and sorghum seeds for free last year," said Wara, "but we don't know if we could afford to this year."