Lower AIC / BIC is the usual pick among nested models. Print both.
Goal
Compare y ~ x vs y ~ 1.
import pandas as pd
import statsmodels.formula.api as smf
df = pd.DataFrame({'x': [1, 2, 3, 4, 5], 'y': [1, 2, 2, 4, 5]})
m1 = smf.ols('y ~ 1', data=df).fit()
m2 = smf.ols('y ~ x', data=df).fit()
print('aic', round(m1.aic, 2), round(m2.aic, 2))
print('bic', round(m1.bic, 2), round(m2.bic, 2))import pandas as pd
import statsmodels.formula.api as smf
df = pd.DataFrame({'x': [1, 2, 3], 'z': [0, 1, 0], 'y': [1, 4, 2]})
print(smf.ols('y ~ x + z', data=df).fit().aic)import pandas as pd
import statsmodels.formula.api as smf
print(smf.ols('y ~ x', data=pd.DataFrame({'x': [1, 2], 'y': [1, 2]})).fit().llf)import pandas as pd
print(pd.DataFrame({'aic': [10, 8]}))