I don’t know if guinea pigs ever need sweaters, but I had to find patterns for them after seeing the pic above. Here are two patterns—one knit & one crochet.
Jen over at Knittersrow has a pattern for knitting a sweater she created for her guinea pig, Nicholas.