Peel the yellow onions and slice them thinly into half-moons.
Melt the ghee in a large heavy-bottomed pot over medium-low heat.
Add the sliced onions and sea salt to the pot, cooking for 30 to 40 minutes while stirring occasionally until the onions are deeply caramelized and jammy.
Deglaze the pot with balsamic vinegar, using a wooden spoon to scrape up all the flavorful browned bits from the bottom.
Pour in the beef bone broth and add the fresh thyme and black pepper.
Bring the soup to a gentle simmer and let it cook for 15 minutes to allow the flavors to fully develop.
While the soup simmers, toast the sourdough slice until it is golden and very crisp.
Ladle the hot soup into an oven-safe crock or bowl, place the toasted sourdough on top, and cover with the shredded Gruyère cheese.
Place the bowl under a broiler for 2 to 3 minutes until the cheese is melted, golden-brown, and bubbling.