Ms. Graham, 35, said she started cycling in and out of hospitals when she was 20. She was raised Mormon, but said she struggled as a teenager to reconcile the church’s views on homosexuality with the realization that she is bisexual. She said she had tried to kill herself with a drug overdose, and had struggled to fight off crippling depression and anxiety while juggling the demands of holding down a job and keeping an apartment.

She found an outlet in writing — she has published one young-adult novel through a small publisher of lesbian fiction — and found solace in group therapy and group discussions at Valley Mental Health with other people trying to cope with mental illness.

Valley Mental Health, which had about 10,000 clients before the recent reductions, is by far the largest and most expansive mental health agency in the state. It treats autistic children, recently released prisoners, people who have just attempted suicide and those who need little more than prescription refills to help manage their depression or anxiety.

The organization has also faced years of money problems. In 2009, it announced plans to lay off more than 100 employees and slash several programs to cope with drastic budget shortfalls. Over the past two years, Valley Mental Health said, its $28 million budget fell by more than $5 million, as the county received less in Medicaid payments and a for-profit company took over managing mental health services in Salt Lake County.

County officials hired that company, OptumHealth, a subsidiary of the UnitedHealth Group, to bring more efficiency and wider services to public health care. But Valley Mental Health seemed to struggle under the new layer of private management.

“We were the safety net,” said Gary Larcenaire, Valley Mental Health’s chief executive. “We went from ‘We want to take care of you’ to ‘Can we have your insurance card?’ ”