We use the kinematics of ~200 000 giant stars that lie within ~1.5 kpc of the plane to measure the vertical profile of mass density near the Sun. We find that the dark mass contained within the isodensity surface of the dark halo that passes through the Sun ((6 ± 0.9) × 1010M⊙), and the surface density within 0.9 kpc of the plane ((69 ± 10)M⊙ pc-2) are almost independent of the (oblate) halo's axis ratio q. If the halo is spherical, 46 per cent of the radial force on the Sun is provided by baryons, and only 4.3 per cent of the Galaxy's mass is baryonic. If the halo is flattened, the baryons contribute even less strongly to the local radial force and to the Galaxy's mass. The dark matter density at the location of the Sun is 0.0126 q-0.89M⊙ pc-3 = 0.48 q-0.89 GeV cm-3. When combined with other literature results we find hints for a mildly oblate dark halo with q ≃ 0.8. Our value for the dark mass within the solar radius is larger than that predicted by cosmological dark-matter-only simulations but in good agreement with simulations once the effects of baryonic infall are taken into account. Our mass models consist of three double-exponential discs, an oblate bulge and a Navarro- Frenk-White dark matter halo, and we model the dynamics of the RAVE (RAdial Velocity Experiment) stars in the corresponding gravitational fields by finding distribution functions f (J) that depend on three action integrals. Statistical errors are completely swamped by systematic uncertainties, the most important of which are the distance to the stars in the photometric and spectroscopic samples and the solar distance to the Galactic Centre. Systematics other than the flattening of the dark halo yield overall uncertainties ~15 per cent.