Seriously ill dog, need suggestions?

So my girlfriend’s adorable cocker spaniel has been sick for a while, since roughly late november. He’s been to three different vets, tried endless suggestions from vet’s, vet tech’s and just people who know dogs. He throws up, every day; sometimes bile, sometimes food depending on how long after he’s eaten. My girlfriend rescued him from a shelter about three years ago and he’s always had a sensitive stomach, pooping bloody liquid stuff if his diet is ever altered significantly. He’s been on Medi-Cal Gastro, until about a two months ago when he stopped eating it, he was then put on Medi-Cal Dental, which he just threw up and stopped trying to eat after two weeks (vet said he had bad teeth).

He’s been losing weight ever since, and is not willing to eat more than a coule munches of Gastro each meal. He was put on Hills z/d by a vet, because they thought the stomach was having trouble breaking down the proteins (however this food is so low in nutrients that he can’t stay on it, and he stopped eating it after about 3 or 4 days, meanwhile his poop was almost diarrhea like, though vomitting frequency decreased). Like i said, he now refuses to eat that, and after 4 days of not eating (his food gets put down for half an hour each meal), i caved and gave him the Gastro food again which he kinda picked at and ate maybe 1/4 of a bowl (chewing but not swallowing some kibble). This is pretty much regular behavior now. Anyway she’s spent about 2k on various solutions over the last 2 months, and she’s only a student already 25k in debt from that. Now when he pukes she just cries.

The next option is to get a scope/surgery, but she just doesn’t have the money. He’s been given worrm medication, endless checkups, and is currently on Tylosin for 30 days twice a day (don’t remember his full treatment history off the top of my head, though my gf would know). He has lost so much weight, weighing 14.5kg before, he now weighs 11.8kg, his ribs are horribly prominent and his spine protrudes even when standing normally. He used to be perfectly active despite this vomiting, but lately has been getting lethargic and slow on walks. I’m afraid of the inevitable happening if this keeps up. The vet’s just don’t know what it is.

In our recent attempt to fix what’s wrong, on another suggestion from a vet, we found some natural food “Natural Balance L.I.D. sweet potatoe and venison” which he actually ate a whole bowl!!! It’s grain free, contains essentially only sweet potato, venison, potatoe protein and venison meal with vitamins.
This was an attempt to see if he was allergic to either grain or chicken/stuff found in classical foods. It stayed down for 8hrs, but he just threw it up (looks undigested like its just been sitting in his stomach, ie its not just bile). i think he’s gonna die soon if something doesn’t change. I tried to feed him more of it before he threw up and he wouldn’t eat. He won’t even eat treats (natural ones made of nothing but venison, apple, peas and carrots). She’s out of money, idea’s and her mental health isn’t gonna last much longer at this rate.

Hey thanks for the reply. he has had his bloodwork done and they said nothing came back that is badly out of balance, and that the few things that were bad where because he was vomiting and probably not the cause of his vomiting. She’s considering getting an x-ray done, but is wondering if theres a point, since she couldn’t afford the surgery to fix it if there was a serious blockage anyway and the vets didn’t seem to put blockage high on the list, i think because he was pooping normally before the most recent food.