While the right to a jury trial is waiveable, in order to have a bench trial in a federal district court, the court and prosecutor generally must agree.
before any waiver can become effective, the consent of government counsel and the sanction of the court must be had
(Patton v. United States, 281 U.S. 276, 312 (1930))
This is codified in Rule 23(a) of the Federal Rules of Criminal Procedure.
However, just because the waiver can be (and generally is) conditioned on governmental consent, some courts have nonetheless allowed the defendant's request for a bench trial despite the lack of consent from the government. See e.g. United States v. Panteleakis, 422 F. Supp. 247 (D.R.I. 1976) (a trial against multiple defendants that would require considering "approximately 1,000 exhibits," "over a three month period," with some evidence admissible against some defendants while inadmissible against others; and the government did not try to "rebut the inference that substantial prejudice [in a trial by jury] is practically impossible to avoid under these circumstances").
This possibility appears to have been left open by the Supreme Court in Singer v. United States, 380 U.S. 24 (1964):
We need not determine in this case whether there might be some circumstances where a defendant's reasons for wanting to be tried by a judge alone are so compelling that the Government's insistence on trial by jury would result in the denial to a defendant of an impartial trial.