Catalyzes the stereospecific NAD(P)H-dependent reduction of 2-ketocarboxylic acids into the corresponding D-2-hydroxycarboxylic acids. Can use both NADPH or NADH as reductant, displaying a marked preference for NADPH over NADH. Shows a broad substrate specificity, although it displays a marked preference for the 2-ketocarboxylic acids having an unbranched chain of 4-5 carbon atoms. Homotetramer. Belongs to the D-isomer specific 2-hydroxyacid dehydrogenase family.