Yes, I stopped breastfeeding at 5 months because of my son's severe allergies to milk and soy. Since birth he had had terrible colic, terrible digestive issues, bad eczema, and rarely slept more than an hour at a time without waking up screaming in pain.
Our first pediatrician kept telling us that there was absolutely nothing wrong with him; we finally fired her and took him to a gastroenterologist who immediately diagnosed him with milk and soy allergies. Our choices were to stop breastfeeding and put him on Nutramigen hypoallergenic formula (and later the unbelievably expensive Nutramigen AA), or for me to continue breastfeeding and eat nothing but brown rice, chicken, fruit, vegetables, and water until he was at least a year old. Due partly to my issues with exhaustion and postpartum depression, we made the extremely difficult choice to put him on formula. I feel fortunate that I was able to give him five months of breastmilk, even though what I was eating had been making him feel awful.
The gastroenterologist told us that going off of dairy (which I had tried for several weeks when he was two months old) wasn't enough; he was also reacting to proteins from the beef that I ate. All cow proteins, apparently, not just milk and cheese and such.
His symptoms improved about 75% when we put him on Nutramigen at five months old. When he was 13 months old, an allergist diagnosed him with milk, egg, wheat, chicken, and peanut allergies. So even if I had gone on that strict elimination diet, the chicken would have caused him to react and it would have seemed like it wasn't making a difference.
At 17 months now, he is MUCH better but still has days where his tummy hurts a lot, and he still has bad gas sometimes and frequent eczema flareups. Something's still causing allergic reactions but it's really tough to figure it out now that he's older and eating a wider variety of foods.
SO... like some of the other mamas suggest, you might try going on a strict diet of rice, poultry, fruits and veggies, and gradually try adding things back in. I know from experience, though, that doing something like that is very difficult, especially when you're exhausted from caring for a baby with terrible digestive issues. No one judged me for stopping breastfeeding (at least not to my face!) and I surely hope that no one will judge you if you make that choice.
Food allergies are really tough to handle, if indeed that is what your baby has. But there's a lot of us parents out here who deal with it every day and we are here to support you.
Good luck!