4. Let $a, b \in \mathbf{R}$. Then the minimum value of $M=\frac{\left(a^{2}+a b+b^{2}\right)^{3}}{a^{2} b^{2}(a+b)^{2}}$ is $\qquad$ .
4. $\frac{27}{4}$.

Let $a=b=1$, we get
$$
M=\frac{\left(a^{2}+a b+b^{2}\right)^{3}}{a^{2} b^{2}(a+b)^{2}}=\frac{27}{4} \text {. }
$$

Now we prove: $M \geqslant \frac{27}{4}$.
Let $x=a^{2}+b^{2}, y=a b$. Then $x \geqslant 0$, and $x \geqslant 2 y$. Thus, the inequality becomes
$$
4(x+y)^{3} \geqslant 27 y^{2}(x+2 y) .
$$

Notice that,
$$
\begin{array}{l}
4(x+y)^{3}-27 y^{2}(x+2 y) \\
=4 x^{3}+(12 x-15 y) x y-50 y^{3} \\
\geqslant 4(2 y)^{3}+2 y^{2}\left(12 \times 2 y^{2}-15 y\right)-50 y^{3} \\
=0 .
\end{array}
$$

Therefore, the minimum value of $M$ is $\frac{27}{4}$.