Odometer works sometimes but at other times it is all over the place - may show 100MPH
not predictable

Inspect and test the vehicle speed sensor at the left rear of the transfer case, and check its wiring for a break or high resistance. If the cluster was replaced, have it programmed and VIN-unlocked, often requiring a dealer. Also ask GM about a TSB for erratic speedometer operation.
A 2004 GMC Envoy owner reported an erratic or nonworking speedometer while the odometer sometimes worked. Experts recommended checking the vehicle speed sensor, and one owner confirmed a new sensor fixed the problem. Later posts described a replaced cluster and sensor with no codes, leading experts to suggest checking the signal wire and programming the cluster because newer clusters are VIN locked. Another owner with a speedometer that dropped after long drives was advised to contact GM about a TSB that may cover a free or reduced-cost repair.