A mess either way. Krensky is still at risk of a coup by the army leaders & aristocracy. By dropping out of the war he loses further loans from London & New York, a seat at the peace table, has written off regaining Poland & a number of other provinces, risks revolts from colonial provinces... None of that will be acceptable to the Russian upper classes still clinging to the past & their old power base. Odds are Kerensky would be removed from power & a Red/White conflict result.
If somehow Kerensky takes Russia to a peace treaty, and leaves the government without a coup, leading to a modicom of stability post 1919 then its a good thing. There is a third way for Kerensky. That is to cease any effort at stratigic offensive, allowing some small relief. Some soldiers could be demobilized, some war industry allowed to return to civil manufactors, ect.. It may not be enough to save Kerensky, but the odds are longer than if undertaking more failing offensives. If it succeeds then Some last minute 'victory' attacks can be made in 1918 as the Germans collapse & Russia gains from the Entente victory.