The simple answer is at the very beginning, or at least, an early stage. A quantity surveyor can carry out a costing on even a simple outline drawing and then use the assumptions to drive the design process.
If the early design and the budget for the project are poles apart, its best to know this from the very beginning. There’s no point having a wonderful building design if its too expensive to build. A quantity surveyor will nail down the costs early on.