For every unit increase in ALT and AST, the risk of diabetes rose by 1% in all adjusted models (ALT: HR = 1.01; 95% CI: 1.00-1.01, P < 0.001; AST: HR = 1.01; 95% CI: 1.00-1.01, P < 0.001). Here, GPT is linked to diabetes mellitus.