The alliance of Latin American states that has provided crucial support over the past year to the Sandinista Liberation Front, fighting to topple President Anastasio Somoza in Nicaragua, appears to be on the verge of collapse.

Diplomats here said today that Venezuela's new president, Luis Herrera Campins, is unlikely to continue his predecessor's strong diplomatic and financial support of the guerrilla group, assistance that may have included arms.

Meanwhile, Costa Rica this week informed Panama that it can no longer allow the Sandinistas to operate in Costa Rica, which separates Panama from Nicaragua. It is thought that the guerrillas will find it more difficult to wage war against Somoza if Costa Rica is successful in preventing them from using its territory.

Panama will continue providing access and safe sanctuary for the Sandinistas, one well-informed diplomat said, but the changes in Venezuela and Costa Rican policy "will probably mean that Somoza will remain in power until 1981 -- at least." Elections are scheduled then and Somoza has promised not to run.

While diplomatic observers and advisers close to Herrera stressed in interviews that the new Venezuelan president is as opposed to the Somoza regime as was his predecessor, Carlos Andres Perez, these sources said Herrera is unlikely to be as outspoken on the subject and probably will not provide additional financial support to the Sandinistas.

Whether Perez provided the guerrillas with arms directly or gave them money to buy guns is not clear. But there is no doubt that the Perez administration was a key backer of the Sandinista cause, both financially and diplomatically.

Perez is known to have interceded personally with President Carter in an effort to influence the U.S. position on the Somoza government, which until last year enjoyed complete backing from successive American presidents.

Perez also sent Venezuelan air force planes to pick up the Sandinistas and their hostages after the guerrillas captured the congressional palace in Managua.

Herrera, in his inaugural address Monday, spoke of the need to recongnize "pluralism" among the governments of Latin America, an indication that he will seek harmonisous relations with all other countries in the region.

Perez, who made much of the fact that Venezuela is one of only four democracies in Spanish-speaking America, had a tendency to lecture other Latin governments while also seeking to become Third World leader, something in which Herrera seems less interested.

Although the Sandinistas will miss Venezuela's support, diplomatic observers here said that Costa Rica's decision to try to stop the guerrillas' use of its territory could be even more crucial.

Under Perez, Venezuela had supported Costa Rica in allowing the Sandinistas to launch raids from inside the country. Last year, Perez sent military planes to Costa Rica as a warning to Somoza not to continue attacks against the guerrillas before they crossed into Nicaragua.

However, Costa Rican President Rodrigo Carazo Odio is reliably reported to have told Panamanian representatives attending Herrera's inauguration this week that the raids by Somoza's soldiers have continued and have taken an unacceptably high toll among Costia Rican peasants living near the border.

As a result, Carazo said, he must get the Sandinistas out of Costa Rica. If the guerrillas put up a fight, however, it is not clear how Carazo would force them out since Costa Rica is one of the few countries without an army.

Diplomatic observers here say Perez blamed the United States for failing to take steps that Perez thought would have ended the 45 years of Somoza family rule.

During the brief outbreak of civil war last September, Perez was quoted as saying: "had the United States adopted a more energetic attitude, much suffering and many unnecessary deaths could have been avoided. I hope Carter's expressed concern over Nicaragua is sincere but pressure groups in Washington seem to be detaing him."

Sources here said Perez supported the Sandinistas not so much because he thought they could beat Somoza's National Guard militarily but as a way of convincing the Carter administration that the alternative to toppling Somoza in favor of a civilian coalition would ultimately be a more radical regime, emerging from civil war and dominated by the guerrillas.

These same sources said the Carter administration rejected the covert action sought by Perez after unauccessfully trying to get members of the Organization of American States to act in concert. The result is that Somoza is still in power, his domestic civilian opponents appear unable to provide an alternative and the Sandinistas seem to be on the verge of losing their support from Venezuela and Costa Rica.

Most observers here believe Herrera will not change such foreign policy objectives as to promote ever-higher oil prices through the Organization of Petroleum Exporting Countries, to foster closer ties among Latin and Caribbean nations and to work for, or at least publicity support, the restoration of democratic governments in a part of the world where military governments predominate.