Don't leave it too late to mediate - delaying settlement discussions may cause unnecessary expense and anxiety for your client.
Of course you need to understand your case, and its strengths and weaknesses, before you can properly advise your client. Equally, the legal merits may not be the only consideration - what your client really needs (even if they don't know it yet) is a sensible commercial settlement before costs escalate.
It is always worth inviting the other party to attempt settlement by mediation, mentioning relevant case law and the CPR to help guard against costs.
Consensus Mediation can approach the other party for you, if you prefer.
Use the Mediation Checklist to guide you.
For the future, consider inserting a mediation clause into your contracts. Whilst there remains some debate about the enforceability of such a clause, the point is not about enforcing it, but rather allowing you to raise the possibility of mediation without 'loss of face' or showing 'a sign of weakness'.