4. Given a regular quadrilateral pyramid $\Gamma$ with height $h=3$, and the angle $\theta=\frac{\pi}{3}$ between the side face and the base. First, place an inscribed sphere $O_{1}$ inside the regular quadrilateral pyramid $\Gamma$, then place spheres $O_{2}, O_{3}, \cdots$ in sequence, such that each subsequent sphere is tangent to the previous sphere and the four side faces of the regular quadrilateral pyramid $\Gamma$. Then the sum of the volumes of all the spheres placed is $\qquad$
4. $\frac{18 \pi}{13}$.

It is known that, $\cos \theta=\frac{1}{2}$.
Then $h=\frac{r_{1}}{\cos \theta}+r_{1}=3 r_{1} \Rightarrow r_{1}=\frac{1}{3} h=1$.
Define $s_{n}=r_{1}+r_{2}+\cdots+r_{n}$.
By $3 r_{n}=h-2 s_{n-1}(n \geqslant 2)$
$$
\begin{array}{l}
\Rightarrow 3\left(r_{n}-r_{n+1}\right)=2 r_{n} \Rightarrow r_{n+1}=\frac{1}{3} r_{n} \\
\Rightarrow r_{n}=\left(\frac{1}{3}\right)^{n-1} \\
\Rightarrow \sum_{i=1}^{n} V_{i}=\sum_{i=1}^{n} \frac{4 \pi}{3} r_{i}^{3}=\frac{4 \pi}{3} \sum_{i=1}^{n}\left(\frac{1}{3}\right)^{3 i-3} \\
\Rightarrow \lim _{n \rightarrow \infty} \sum_{i=1}^{n} V_{i}=\frac{18 \pi}{13} .
\end{array}
$$