We define a new inhomogeneous mean-field algorithm to study the magnetic alloy LiHo1−xYxF4. The phase diagrams in the Hx-T, x-T and x-Hx planes are computed. The calculated critical temperature is overestimated by 27% and the critical field is underestimated by 29%. The later discrepancy is due to the hyperfine coupling which has been neglected in our model. The reasons for the temperature discrepancy are discussed. The critical exponents for the magnetic susceptibility are found to be mean-field ( = ′ = 1) for small dilution and seems to decrease at high dilution, although a more systematic work is required to establish it. Signs of a spin glass phase taking place for dilutions greater than x = 0.84 has been found and extensively discussed. Finally, an history dependant ordering is observed for x = 0.9 accordingly to recent neutron scattering experiments.