First, ask yourself why you want to stop your dog from sniffing. Sniffing is something that's really important to dogs. From a practical perspective, sniffing a lot will tire your dog out, so when you get home your dog is less likely to have other training issues. Does it really cost you so much to let your dog "live a little"?
If yes, then there is a reward you have that you already know is important to your dog: the ability to sniff. This is an amazing gift! You can train your dog through positive reinforcement when you don't have treats on you, because there is almost always something nearby that your dog wants to sniff.
You just need to make allowing your dog to sniff contingent on doing what you want first. To start, adjust your dog's collar so it is right behind his ears, and give him enough leash to be comfortable standing or sitting, but he can't get his nose to the ground. Then wait. Your dog is going to try to sniff, then look at you like "huh"? If you already have a marker (clicker, "yes", etc.), use that, then say "ok, go sniff." If not, this might be a good way to get started.
Let him sniff a bit, then stick a treat right in his face and raise his head so you can restart by adjusting his collar.
Make sure to keep what you're asking for very short in the beginning. The reason this works is because it doesn't cost much for your dog to do what you want, and it isn't the end of what he wants to do--it's a way for him to be able to get you to give him what he wants.
My dog loves to sniff as well, and when I walk him I stop at the places he has indicated are the most tempting to sniff and ask him to work--usually a few steps of heeling with a sit or a turn thrown in--at each one before he can sniff. It's great because what started out as a distraction is what's now motivating him to work.