London Breed, a candidate for mayor in one of San Francisco’s most disputed elections in recent memory.

SAN FRANCISCO — Over the last decade, this has become the tech industry’s hometown.

But as voters go to the polls Tuesday to choose a mayor in one of San Francisco’s most disputed elections in recent memory, the industry that set off a high-rise construction boom and has been blamed for a housing crisis in the city is fading into the background.

That is quite a contrast to the last open mayoral election, in 2011. Tech leaders were featured in a video for their preferred candidate, Ed Lee, who went on to win and was re-elected in 2015. It has been viewed more than 600,000 times on YouTube. This year, several candidates are vying to replace Mr. Lee, who died in December, but none of them has tried to enlist tech in anything so striking.

What is happening — or rather not happening — in San Francisco is part of a broader urge in the tech community to stay behind the scenes in state and national politics. The overwhelmingly Democratic-leaning Silicon Valley was shocked by the 2016 election of Donald J. Trump and aghast at his anti-immigration ban, which cut to the heart of their existence as a multinational industry whose companies have often been founded by immigrants.

Tech got political, fast. Sergey Brin, a Google co-founder born in Russia, told 2,000 employees who were demonstrating against Mr. Trump’s actions in January 2017 that “some of us might even adopt Pence 2017 bumper stickers.” It was all but a direct endorsement of the new president’s impeachment.

The 2016 election of Donald J. Trump and his anti-immigration ban cut to the heart of the tech community’s existence as a multinational industry whose companies have often been founded by immigrants.

But predictions that, for better or worse, tech and politics were henceforth going to be inseparable did not hold up.

Marc Benioff, the chief executive of Salesforce, drew national attention in 2015 when he said he would move his employees out of Indiana if a new state law that would have legalized discrimination was not changed. (It was.)

Mr. Benioff, a native of San Francisco and the most prominent tech executive in the city, was a financial backer of Mr. Lee. But he said in an interview Friday that the mayoral election was too important, too closely fought and too contentious for him to support any of the top four candidates: Jane Kim, Mark Leno, Angela Alioto or London Breed.

“This is the hottest election San Francisco has ever had for mayor,” he said. “I care so deeply, I cannot support one of the candidates. I don’t want to disenfranchise my ability to work with whoever is elected.”

Sam Altman, the president of the influential start-up accelerator Y Combinator, has not tweeted about politics all year — surprising reticence for someone who flirted with the idea of running for California governor last year.

“I’ve just been super busy,” Mr. Altman wrote in an email, adding that he had “no idea” why others had been so quiet. A spokesman for Reid Hoffman, the LinkedIn co-founder who previously showed an intense interest in politics, waved off an inquiry, saying: “Don’t really have anything new to report.”

Mr. Brin has no political thoughts to share at present, a Google spokeswoman said. Even Peter Thiel,…