A novel Python-based open-source optimization framework, namely Pyomo (Python optimization modeling objects), alongside a conventional optimization method, RSM (response surface methodology), was utilized to determine the optimal operating conditions of an alternating current-powered electrocoagulation (ACPE) process for nickel removal. In this regard, four mutable operating factors, current density (5–9 mA/cm2), initial nickel concentration (200–400 mg/L), initial pH of the solution (5–9), and electrolysis time (30–60 min), along with a fixed amount of an additional eco-friendly substance, Tartaric Acid (155 mg/L) were considered. Metal removal efficiency (OF1) and operating costs (OF2) were monitored and evaluated as objective functions with the aim of maximization and minimization, respectively. Experiments were conducted according to the central composite design (CCD), and validation outcomes established a reasonable agreement between the predicted models and the experimental data. The multi-objective optimization process yielded two sets of 30-optimal-solution obtained through Pyomo and RSM. Accordingly, the proposed solutions by the Pyomo were found to be more flexible and eclectic, supplying the local decision maker(s) with a diverse spectrum of optimal operating conditions. Adding TA was also effective in reducing electrical energy consumption by up to 46%.