I've done 2 shrimp in 1/2 liter (1 liter is ~1/4 gallon) so it's very possible. Use neo shrimp only, as I've found that they're the hardiest of all. I would remove the shells though, as they would be altering the water chemistry.
Mine was no-tech and indirect sunlight only. 95% water changes once a week, Osmocote+ pellets once every few months. I'd drop in a single flake of food 1-2 times a week. Healthy snail population in there as well. Make sure plants are growing by time shrimp are added, although I've also done a setup in the same tank where I added a shrimp 4 days after setup. It was fine.
I've also done a hands-off jar, even smaller, where all I would do is top off with fresh water. It was dirted, lasted for well over 2 years before I took it down. The snail poop essentially doubled the substrate volume at that point. I did have 1 shrimp in there, but very rarely fed it. It was more of a science experiment than anything else, and was quite interesting.