  We consider homogeneous factor models on uniformly sparse graph sequences
converging locally to a (unimodular) random tree $T$, and study the existence
of the free energy density $\phi$, the limit of the log-partition function
divided by the number of vertices $n$ as $n$ tends to infinity. We provide a
new interpolation scheme and use it to prove existence of, and to explicitly
compute, the quantity $\phi$ subject to uniqueness of a relevant Gibbs measure
for the factor model on $T$. By way of example we compute $\phi$ for the
independent set (or hard-core) model at low fugacity, for the ferromagnetic
Ising model at all parameter values, and for the ferromagnetic Potts model with
both weak enough and strong enough interactions. Even beyond uniqueness regimes
our interpolation provides useful explicit bounds on $\phi$. In the regimes in
which we establish existence of the limit, we show that it coincides with the
Bethe free energy functional evaluated at a suitable fixed point of the belief
propagation (Bethe) recursions on $T$. In the special case that $T$ has a
Galton-Watson law, this formula coincides with the nonrigorous "Bethe
prediction" obtained by statistical physicists using the "replica" or "cavity"
methods. Thus our work is a rigorous generalization of these heuristic
calculations to the broader class of sparse graph sequences converging locally
to trees. We also provide a variational characterization for the Bethe
prediction in this general setting, which is of independent interest.
