6. Let $a$ and $b$ be real numbers, and the complex numbers
$$
\begin{aligned}
z_{1} & =\sqrt{3} a-1+(\sqrt{3}-b) \mathrm{i} \\
\text { and } \quad z_{2} & =2-\sqrt{3} a+b \mathrm{i}
\end{aligned}
$$

have equal magnitudes, and $z_{1} \bar{z}_{2}$ is a pure imaginary number. Then $a+b=$
$$
\begin{array}{l}
\text { Given } \left|\frac{z_{1}}{z_{2}}\right|=1 \text { and } \frac{z_{1}}{z_{2}} \text { is a pure imaginary number. Then } \\
\frac{z_{1}}{z_{2}}= \pm \mathrm{i} . \\
\text { Therefore }\left\{\begin{array} { l } 
{ \sqrt { 3 } a - 1 = - b , } \\
{ \sqrt { 3 } - b = 2 - \sqrt { 3 } a }
\end{array} \text { or } \left\{\begin{array}{l}
\sqrt{3} a-1=b, \\
\sqrt{3}-b=\sqrt{3} a-2
\end{array}\right.\right. \\
\Rightarrow a=b=\frac{\sqrt{3}-1}{2} \text { or } a=b=\frac{\sqrt{3}+1}{2} \\
\Rightarrow a+b=\sqrt{3} \pm 1 .
\end{array}
$$