Timothy E. Kraft, President Carter's 1980 national campaign manager, filed a lawsuit in U.S. District Court here yesterday challenging provisions of a federal law that triggered the appointment of a special prosecutor to investigate allegations that Kraft had used cocaine.

Kraft contends that the 1978 Ethics in Government Act gives the special prosecutor broad and independent law enforcement authority that constitutionally belongs only to the president or the attorney general.

Kraft left the Carter campaign in September after it was disclosed that a panel of three federal judges had appointed New Orleans lawyer Gerald J. Gallinghouse as special prosecutor to investigate charges that Kraft used cocaine in New Orleans on Aug. 10, 1978, and in San Francisco on Nov. 18, 1978.

The Ethics in Government Act, a controversial byproduct of the Watergate era, provides for judicial appointment of a special prosecutor when allegations are raised against high-ranking government officials.

In court papers filed yesterday, Kraft's lawyers argued that Gallinghouse "has, in effect, become the attorney general of the United States with [Kraft] as his sole and exclusive target." The lawsuit, which names Gallinghouse as the sole defendant, also contends that the act unconstitutionally deprives the president of authority to supervise the special prosecutor and restricts his power to remove him from office.

Kraft's attorney, A. Raymond Randolph Jr. and Thomas C. Green, also contend that Gillinghouse's service as a U.S. attorney in Louisiana until February 1978 made him ineligible for appointment as a special prosecutor under the terms of the Ethics in Government Act.