HD 135344B is an accreting (pre-) transition disk that displays the emission of warm CO extending tens of AU inside its 30 AU dust cavity. We used the dust radiative transfer code MCFOST and the thermochemical code ProDiMo to derive the disk structure from the simultaneous modeling of the spectral energy distribution (SED), VLT/CRIRES CO P(10) 4.75 micron, Herschel/PACS [O I] 63 micron, Spitzer-IRS, and JCMT 12CO J=3-2 spectra, VLTI/PIONIER H-band visibilities, and constraints from (sub-)mm continuum interferometry and near-IR imaging. We found a disk model able to describe the current observations simultaneously. This disk has the following structure. (1) To reproduce the SED, the near-IR interferometry data, and the CO ro-vibrational emission, refractory grains (we suggest carbon) are present inside the silicate sublimation radius (0.08<R<0.2 AU). (2) The dust cavity (R<30 AU) is filled with gas, the surface density of this gas must increase with radius to fit the CO P(10) line profile, a small gap of a few AU in the gas is compatible with current data, and a large gap in the gas is not likely. (4) The gas/dust ratio inside the cavity is > 100 to account for the 870 micron continuum upper limit and the CO P(10) line flux. (5) The gas/dust ratio at 30<R<200 AU is < 10 to simultaneously describe the [O I] 63 micron line flux and the CO P(10) line profile. (6) In the outer disk, most of the mass should be located in the midplane, and a significant fraction of the dust is in large grains. Conclusions: Simultaneous modeling of the gas and dust is required to break the model degeneracies and constrain the disk structure. An increasing gas surface density with radius in the inner dust cavity echoes the effect of a migrating Jovian planet. The low gas mass (a few MJupiter) in the HD 135344Bs disk suggests that it is an evolved disk that has already lost a large portion of its mass.