Gravitational light deflection in the Solar System can be detected by high precision astrometric measurements. We discuss the parametrized post-Newtonian framework and the comparison of metric theories of gravity. At the precision of a few micro-arcseconds, Gaia data will permit tests of the PPN parameters beta and gamma and to distinguish monopole and quadrupole gravitational light deflection. Accounting for relativistic effects is necessary to achieve the aimed for precision. The theoretical formulation of light deflection is discussed. We deduce an expression for the source direction derivatives required by the AGIS scheme in a simplified relativistic model. This model accounting for monopole and quadrupole deflection terms has been implemented in AGISLab. We have validated the implementation and maintain convergence of the astrometric solution for Gaia. We investigate the precision of the determination of PPN gamma with Gaia data for the Sun and planets using the new relativistic model for source direction computations. Simulations in AGISLab show that previously obtained precision for PPN gamma can be matched. Full precision Gaia data should allow for a determination down to 10-6. We performed realistic simulations including observation noise and conclude that quadrupole effect remains detectable with a 6 sigma confidence level even for a 5 arcsec radius of the exclusion zone around Jupiter.