I was guided by a Post-Doc for my undergraduate thesis, but the one responsible for all and offering the thesis was a Professor, who I only talked to when discussing the thesis, agreeing to it, and the explanation of the grade in the end. Who of both would be the one to ask for a letter of recommendation? More general, should you always ask the person with who one was mostly in contact during work, or the person responsible for it all, if they are not the same person?
It might be worthwhile to remember what a letter of recommendation is for. If you have to choose between the two, I would recommend asking the postdoc, as I presume from your description that he knows you better.
The professor might be well-known, but if he doesn't know you enough, he may not be able to write a strong letter and he might end up asking you to draft the letter. This is quite a common practice, but I believe should be avoided if there is already someone who can write you a recommendation without asking you to draft it.