In Diesel engines combustion proceeds essentially under partially premixed and non-premixed conditions. In this study the flamelet model for non-premixed combustion is derived and its implementation into 3-D codes is discussed. The model is capable of describing auto-ignition, the following burnout of the partially premixed phase, and the transition to diffusive burning. Flamelet modeling has the advantage of separating the numerical effort associated with the resolution of fast chemical time scales from the fluid dynamics' scales occuring in the 3-D computation of the engine combustion cycle. Three additional scalar field equations have to be solved in the 3-D engine code, while the entire chemistry consisting of up to 1000 or more chemical reactions is simultaneously treated in a separate 1-D code describing the flamelet structure. A new aspect proposed here is to use so-called RIFs (Representative Interactive Flamelets), which are solved on-line with the 3D-code. The parameters and boundary conditions that govern the unsteady evolution of these flamelets are provided from the 3-D engine calculation at each time step by statistically averaging over the spatial domain of interest within the combustion chamber. The flamelet structure is then computed in the 1-D code as a function of the local mixture distribution so that the mean temperature and concentrations within the combustion chamber including soot and NOx can be determined.In this study numerical simulations for an n-heptane fueled DI Diesel engine with exhaust gas recirculation (EGR) are performed in order to predict the chemical details of the combustion process and the resulting pollutant formation. The gas phase chemistry has been described with a detailed chemical mechanism, which accounts for ignition, the oxidation of the fuel, NOx formation and destruction, and the build-up of poly-cyclic aromatic hydrocarbons (PAHs) up to four aromatic rings. The further growth of the PAHs, the formation of soot particles, and the interaction of particles with other particles and the gas phase is described by a kinetically-based soot model. NOx formation is described by thermal, prompt, nitrous, and reburn chemistry. Comparisons of the calculations with experimental data for pressure, ignition delay, soot mass, NOx, and major species concentrations show good agreement. The influence of the EGR rate on soot and NOx formation is investigated and discussed.