Hi there ~
It is concerning with your weight loss
and painless but swollen upper left ribs. I suggest that you go to a surgeon who can do a thorough check up and make sure that he / she rules out any malignant (cancerous) condition. I hope you take this seriously and visit with your doctor as soon as you can.
I hope this helps. Take care and have a lovely day !