Welcome to the community!
I second what Scott said, you really need to get your Pionus to either a CAV or an Avian Specialist Vet only, no Exotics Vets, for two reasons: #1 Because it's been "several years" and parrots should have a full Wellness-Exam that includes at least a Fecal Culture and full Blood-Work at least once every single year anyway, and then #2 More importantly is that I'm quite certain based on his diet of mostly peanuts that he is suffering from not only several nutritional deficiencies, but he's also suffering from Fatty Liver Disease almost certainly, and possibly Diabetes, Kidney Disease, etc. He should have a lot of life left at only 16 years old, but as you said "he's not looking healthy" because he's not. Not only has his diet been pretty much nothing but fat/oil and a bit of bad protein and that has no doubt caused him physical illness, but he's also not gotten any of the vitamins/minerals, amino acids, healthy protein, or basically any of the nutrition that he needs...
****Will he eat seed-mix? He would be much, much, much better-off if he was eating a healthy, low-fat seed-mix every day (or for that matter a junky seed-mix would be much, much better if I'm being honest with you) than only peanuts. Pellets aren't for every bird, at least not without working on a proper transitional-plan to them, but no parrot can live on peanuts only with a few sugary fruit pellets once in a while. That's just not good, and if you were feeding him even a junky, cheap seed-mix for large parrots that you buy at Walmart he'd be much better off, at least he'd be getting enough calories, protein, and vitamins and minerals. The main reason you shouldn't feed captive/pet birds a staple of seed-mix is because of the high fat-content and the risk of Fatty Liver Disease, but if he's only been eating mainly peanuts his entire life then he's already in that situation and still not getting any nutrition, so the seed-mix would be a HUGE step-up. I would first try going to Petco and choosing a healthy, low-fat, varied seed-mix that contains NO Sunflower Seeds, NO Nuts of any kind, including NO Peanuts, and NO Dried Corn/Cracked Corn at all, and see if he'll eat that, as most birds will eat seed-mix. These healthy seed-mixes contain lower-fat, healthier seeds, fresh grains, legumes, herbs, veggies and fruit (dried), and if he'll eat one of these healthy seed-mixes it will start the recovery of his Liver and Kidneys. Two good ones are Tropimix and Higgins California Blend...Another to try would be Higgins Safflower Gold, it's a little more seed-based, but still contains no Sunflower Seeds, No Nut/Peanuts, and No Corn, and most birds love the Safflower Gold. He'd be so much better off eating a seed-mix daily and having you stop all of the peanuts/nuts...I'd at least give it a try, and if he'll eat the seed-mix then you can worry about pellets...He just needs some nutrition!!
Something to remember here (and something that many parrot owners need to be reminded of, including myself) is "If you don't give it to your bird, they can't eat it!"...I've never in 33 years EVER seen a parrot starve himself to death because he didn't like what was in his bowl, that's just not how they're wired, they are wired for survival...In your bird's case, because he's so malnourished and unhealthy due to a total lack of nutrition, I would never suggest just putting pellets in his bowl and waiting for him to give-in and eat them because he needs nutrition...But I would however completely stop ALL the peanuts and any other nuts and I would fill his bowl with one of the healthier seed-mixes like the Higgins Safflower Gold or the Tropimix, and then I'd just wait him out, because HE WILL eventually eat it. And most birds will eat seed-mix regardless...It's just a matter of you being able to wait him out and not give-in and give him nuts...
In addition to getting him to a CAV immediately (he needs to be put on a liver medication, or supplement, such as Milk Thistle) and stopping the peanuts completely and feeding him a seed-mix so he can simply get some well-rounded nutrition, I'd also in your bird's case talk to the CAV about vitamin supplementation in the short-term, until he's been eating more nutrition for a while...Your CAV will most-likely suggest different vitamin/nutritional injections/supplements based on what his Blood-Work looks like...In fact, if while you're at Petco buying a healthy seed-mix for him to eat, you wanted to pick-up a bottle of Qwiko Avian Multi-Vitamins to sprinkle on his seed-mix once a day, I actually think that would be a good thing in your bird's case...Don't ever buy any type of "vitamin drops" or any other supplements that go in their drinking water, they are terrible, you can't control the dose and anything you put in their drinking water contaminates it and grows bacteria, fungi, etc. So don't EVER put anything in his water at all! But Petco sells Qwiko Avian Multi-Vitamin, which is a powder that comes in a little bottle and has a pre-measured scoop, and you simply sprinkle them overtop of his fresh seed-mix you give him in the morning, and it's actually pretty good stuff. Most pet parrots don't need any type of Multi-Vitamin because even if they are eating a healthy seed-mix and fresh veggies/fruit, they are getting the proper nutrition they need daily...But your bird would be one who would benefit from a proper Avian Multi-Vitamin once daily sprinkled on his food..
Again, you need to at the very least give it a shot, and you need to be strong and wait him out...He won't starve himself to death, and if you feed him a healthy seed-mix he'll most-likely like it and want to eat it...But he cannot eat the peanuts if you don't give them to him, and he won't starve himself to death. He needs a complete diet/nutritional change ASAP, and he needs just basic nutrition that a healthy seed-mix will provide...