Red ripe tomatoes are considered a safe food for guinea pigs, but only the ripe fruit should be fed to guinea pigs. Green tomatoes, tomato leaves and stems contain toxic compounds that can make guinea pigs ill.
Unripe tomatoes and other green parts of the plant contain tomatine and solanine. Tomatine is a toxic alkaloid that also occurs in small amounts in ripe tomato fruit, but it has no toxic effect at such low levels. In the higher amounts present in green tomato plant parts, it can cause illness. Solanine is the same toxin found in potatoes and other plants related to nightshade. Solanine is so toxic to guinea pigs that feeding potato peels to them is not recommended. Ripe tomatoes, especially small fruit such as cherry tomatoes, pose no danger to guinea pigs and are a recommended part of their diet.