6. $\frac{4-\sqrt{6}}{5}$.

When the radius is maximized, the small sphere is tangent to three faces of the cube. Suppose the small sphere is tangent to the three faces passing through point $D_{1}$. Taking $D_{1}$ as the origin, $\overrightarrow{D_{1} C_{1}}$, $\overrightarrow{D_{1} A_{1}}$, and $\overrightarrow{D_{1} D}$ as the positive directions of the $x$, $y$, and $z$ axes, respectively, we establish a spatial rectangular coordinate system.
Let $A(0,1,1)$, $C_{1}(1,0,0)$,
and the center of the small sphere $P(r, r, r)$.
Then the distance from point $P$ to $A C_{1}$ is
$$
\frac{\left|\overrightarrow{A P} \times \overrightarrow{A C_{1}}\right|}{\left|\overrightarrow{A C_{1}}\right|}=\sqrt{\frac{2}{3}}|1-2 r|=r \text {. }
$$

From $r<\frac{1}{2}$, we get $r=\frac{4-\sqrt{6}}{5}$.
6. Inside a cube $A B C D-A_{1} B_{1} C_{1} D_{1}$ with edge length 1, there is a small ball that is tangent to the diagonal segment $A C_{1}$. Then the maximum radius of the ball is $\qquad$ .