Preheat oven to 375°F (190°C).
In a large skillet, melt butter over medium heat. Add sliced onions and cook for 25 minutes until deep golden brown and caramelized. Remove half of the onions and set aside for topping.
In a small bowl, combine beef broth and breadcrumbs; let sit for 5 minutes to hydrate.
In a large mixing bowl, combine ground beef, hydrated breadcrumbs, the first half of the caramelized onions, eggs, Worcestershire sauce, thyme, garlic, salt, and pepper. Mix until just combined.
Shape the mixture into a loaf on a parchment-lined baking sheet.
Bake for 45-50 minutes until the internal temperature reaches 160°F (71°C).
Remove from oven and top the loaf with the remaining caramelized onions and shredded Gruyere cheese.
Place under a broiler for 3-5 minutes until the cheese is melted and bubbly.
Let rest for 10 minutes before slicing and serving.