1. Rinse and sort the beans. Soak the beans overnight covered in cold water.
2. 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 1/2 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.
3. In a Dutch oven or large stockpot, heat the olive oil.
4. Add the onions or leeks and cook, stirring occasionally, until soft and translucent.
5. 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.
6. While the soup is cooking, make the pistou.
7. Pound the garlic to a paste in a mortar and pestle (or use a food processor) with a generous pinch of salt.
8. Coarsely chop the basil leaves and pound them into the garlic until the mixture is relatively smooth.
9. Drizzle in the olive oil slowly, while pounding, then pound in the tomato and cheese. Taste, and season with more salt if desired.