Entanglement is believed to be crucial in macroscopic physical systems for understanding the collective quantum phenomena such as quantum phase transitions. We start from and solve exactly a novel Yang-Baxter spin-1/2 chain model with inhomogeneous and anisotropic short-range interactions. For the ground state, we show the behavior of neighboring entanglement in the parameter space and find that the inhomogeneous coupling strengths affect entanglement in a distinctive way from the homogeneous case, but this would not affect the coincidence between entanglement and quantum criticality.