Do not fully cook the potatoes as jacket potatoes.
In the meantime, cut the leek into fine rings, wash well, drain and sweat in butter in a large saucepan. Add a finely diced clove of garlic to taste. Salt and pepper, then deglaze with white wine, reduce a little and then deglaze with the vegetable stock. Add the sour cream and half of the cream. Add the thyme and season everything well with salt, pepper and chilli. If necessary, add the second half of the cream. Since the potatoes are not seasoned and will swallow a lot of the seasoning later, they can be seasoned really generously. Peel the potatoes and cut into slices.
Grease a baking dish and layer alternately with potatoes and leek vegetables. Then rub the cheese over it.
Bake the gratin in a hot oven at 160 ° C for about 20 - 30 minutes until the cheese melts and is lightly browned.