Dr. Louis Levin, a biochemist who held a number of positions at the National Science Foundation and who retired in 1972 as an assistant director of the agency, died of cancer Wednesday at his home in Santa Barbara, Calif.

Dr. Levin first joined the NSF in 1952 and remained there until 1960. He spent the next four years as the dean of science at Brandeis University. In 1964, he returned to the NSF and remained there until his retirement.

During his earlier years at the fountaion, Dr. Levin's duties ranged from heading the office of institutional programs to serving as program director for regulatory and metabolic biology.

When he returned from his years at Brandeis, he was head of the office of program development and analysis and then associate director of institutional relations. In 1968, he was named executive associate director. A year later, he became one of the first presidentially appointed assistant directors of the NSF.

From 1972 to 1974, Dr. Levin was a consultant to Texas Tech University in Lubbock, Texas, and then retired to Santa Barbara.

He was born in Milwaukee and earned a bachelor's degree in chemistry at Kalmazoo College in Kalamazoo, Mich. He earned his doctorate in biochemistry at the St. Louis University School of Medicine. For the next several years, Dr. Levin was a teaching assistant at Columbia University in New York City and a researcher at the Michael Reese Hospital in Chicago.

He began his government career as head of the biochemiistry branch of the Office of Naval Research in New York City in the late 1949s. He transferred to ONR headquarters in Washington in 1950.

Dr. Levin, who wrote more than 50 technical papers in the field of biochemical endocrineology, was a member of numerous professional and learned societies.

Survivors inclue his wife, Esther, of Santa Barbara; two children, David, of Chicago, and Miriam Leventhal, of Detroit; his father, Jacob, a resident of the Hebrew Home of Greater Washington, and four grandchildren.