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?
You should ask the professor for the letter. It is likely the professor will get help from the postdoc in writing the letter. There is a traditional belief that the professor's opinion is worth more, so whoever is reading the letter will expect to get a letter signed by the professor.