Consider the following classical Lagrangian with an interaction between velocities:
$$\mathcal{L} = \sum_{i} \frac{1}{2}m \mathbf{v}_{i}^{2} + \sum_{i < j} J(r_{ij}) \hat{\mathbf{v}}_{i} \cdot \hat{\mathbf{v}}_{j},$$
where $r_{ij} = |\mathbf{r}_{i} - \mathbf{r}_{j}|$, $\mathbf{v} =\dot{\mathbf{r}}$, and $\hat{\mathbf{v}} = \mathbf{v} / |\mathbf{v}|$. Models like this come up in studies of collective behavior, like bird flocking.
The canonical momentum is
$$\mathbf{p}_{i} = m \mathbf{v}_{i} + \dfrac{1}{v_{i}} \sum_{j \neq i} J(r_{ij}) \left( \hat{\mathbf{v}}_{j} - (\hat{\mathbf{v}}_{j} \cdot \hat{\mathbf{v}}_{i}) \hat{\mathbf{v}}_{i} \right).$$
It may be helpful to define the "averaged velocity" $\mathbf{d}_{i} \equiv \sum_{j \neq i} J(r_{ij}) \hat{\mathbf{v}}_{j}$, in which case we can rewrite the canonical momentum as
$$\mathbf{p}_{i} = m \mathbf{v}_{i} + \dfrac{1}{v_{i}} \left( \mathbf{d}_{i} - (\mathbf{d}_{i} \cdot \hat{\mathbf{v}}_{i}) \hat{\mathbf{v}}_{i} \right).$$
Noticing that the non-standard term in the momentum is orthogonal to the velocity $\mathbf{v}_{i}$, we can easily write the corresponding Hamiltonian in terms of the velocities as
$$\mathcal{H} = \sum_{i} \frac{1}{2}m \mathbf{v}_{i}^{2} - \sum_{i < j} J(r_{ij}) \hat{\mathbf{v}}_{i} \cdot \hat{\mathbf{v}}_{j}.$$
Question
Is it possible to explicitly write the Hamiltonian $\mathcal{H}$ solely in terms of the canonical positions $\mathbf{r}_{i}$ and momenta $\mathbf{p}_{i}$?
Through calculating dot products of $\mathbf{p}_{i}$ with $\mathbf{v}_{i}$, $\mathbf{d}_{i}$ and $\mathbf{p}_{i}$, I have managed to get to the expression
$$\mathcal{H} = \sum_{i} \dfrac{\mathbf{p}_{i}^{2}}{2m} - \sum_{i} \dfrac{1}{2m v_{i}} \mathbf{p}_{i} \cdot \mathbf{d}_{i},$$
but so far I haven't managed to completely eliminate the velocity dependence.