Chop the carrot, celery, and onion. Finely chop the garlic. Slice the bacon.
Set the Instant Pot to the sauté function. Let heat for a minute or two. Add the olive oil and the bacon or ham (if using).
Cook for about 2 to 5 minutes, until most of the fat has rendered.
Add the carrots, onion, and celery. Cook for 2 to 3 minutes, until the onion is softened.
Add the garlic and cook until fragrant, 30 seconds to 1 minute.
Add the beans, broth, and dry seasonings - rosemary and thyme, salt, pepper, chili flake (if using).
Secure the lid. Set the Instant Pot to high pressure for 35 minutes.
Once the soup has finished cooking, manually release the pressure. Carefully remove the lid, stir in the red wine vinegar, and serve with fresh herbs like parsley or basil and a sprinkling of freshly grated parmesan.