This is something I have been struggling with ever since staring keto 4 years ago.
I’ve settled on:
Low intensity (zone 2 - a nice solo road ride) up to 4 hours - just water. More than 4 hours, a meal of 100% meat sausages during the ride. I take them pre-cooked. My butcher makes them with a ton of salt in them too.
Medium intensity (riding with friends so I can’t control the intensity) water for the first hour, then a piece of dried fruit (prunes / figs) every 30 minutes or so. More if you can feel the acidity with lactate being produced, but I really try to limit that as I’m convinced that’s inflaming my arteries. I drop behind my friends if necessary, and re-group later. I don’t go out with folks who want to hammer it for hours at zone 3/4 (sadly I did this for decades, which is probably why I have a CAC in the 300s).
Higher intensity(MTB x-country) up to an hour - just water, but some dried fruit (3 or 4 prunes/figs/dates (I don’t find dates work well during a ride)) directly after.
In all cases 1/2 a butternut squash with the evening meal.
I seem to keep in ketosis with this. If I don’t exercise, I’m very low carb - meat and leafy greens only.
Obviously, YMMV.