The gas sweetening process is essential for removing harmful acid gases, such as hydrogen sulfide (H2S) and carbon dioxide (CO2), from natural gas before delivery to end-users. Consequently, chemical absorption-based acid gas removal units (AGRUs) are widely implemented due to their high efficiency and reliability. The most common solvent used in AGRU is monodiethanolamine (MDEA), often mixed with piperazine (PZ) as an additive to accelerate acid gas capture. The absorption performance, however, is significantly influenced by the solvent mixture composition. Despite this, solvent composition is often determined through trial and error in experiments or simulations, with limited studies focusing on predictive methods for optimizing solvent mixtures. Therefore, this paper aims to develop a predictive technique for determining optimal solvent compositions under varying sour gas conditions. An ensemble algorithm, Extreme Gradient Boosting (XGBoost), is selected to develop two predictive models. The first model predicts H2S and CO2 concentrations, while the second model predicts the MDEA and PZ compositions. The results demonstrate that XGBoost outperforms other algorithms in both models. It achieves R2 values above 0.99 in most scenarios, and the lowest RMSE and MAE values of less than 1, indicating robust and consistent predictions. The predicted acid gas concentrations and solvent compositions were further analyzed to study the effects of solvent composition on acid gas absorption across different scenarios. The proposed models offer valuable insights for optimizing solvent compositions to enhance AGRU performance in industrial applications.