Melt the butter in a large skillet over medium heat. Add the sliced onions, thyme, salt, and pepper. Cook, stirring often, until the onions turn deep golden brown, about 20 minutes.
Remove half the onions from the skillet and set them aside. Pour the beef broth into the remaining onions and stir to loosen any browned bits.
In a mixing bowl, combine the ground beef, the onion-broth mixture, breadcrumbs, and egg. Mix gently until the ingredients just come together.
Divide the mixture into four equal portions and shape each into a small loaf. Place the loaves on a baking sheet.
Top each loaf with the reserved caramelized onions and an even layer of shredded Gruyère.
Bake at 375°F for 25 minutes, or until the internal temperature reaches 160°F. Let the loaves rest for 5 minutes.
Serve the meatloaves with the baguette slices on the side.