Rinse and sort the beans. Soak the beans overnight covered in cold water.
The next day, drain the beans and put them in a large saucepan with the bay leaves and enough water to cover the beans with about 1 ½ quarts (1.5l) of water. Cook the beans for about an hour, or until tender, adding more water if necessary to keep them immersed. Once cooked, remove the beans from the heat and set aside.
In a Dutch oven or large stockpot, heat the olive oil.
Add the onions or leeks and cook, stirring occasionally, until soft and translucent.
Add the thyme, diced carrots, zucchini, green beans, garlic, and salt. Season with pepper, and cook, stirring occasionally, until the vegetables are completely cooked.
Add the cooked beans and their liquid, then the peas and pasta, plus 2 quarts (2l) water. Bring the soup to a boil, and simmer a few minutes until the pasta is cooked.
While the soup is cooking, make the pistou.
Pound the garlic to a paste in a mortar and pestle (or use a food processor) with a generous pinch of salt.
Coarsely chop the basil leaves and pound them into the garlic until the mixture is relatively smooth.
Drizzle in the olive oil slowly, while pounding, then pound in the tomato and cheese. Taste, and season with more salt if desired.
To serve: Ladle hot soup into bowls and add a generous spoonful of pistou to the center and swirl gently.
