Let \(\{L_k, k\ge 1\}\) be any increasing unbounded sequence of positive reals and \((a_k)_{k\ge 1}\) a sequence of real numbers such that \(A_x = \sum _{k\le x} a_k^2\uparrow \infty \) , with x. We study moderate deviations of suprema of the Gaussian polynomials \(\begin{aligned} X_{y,x}(u) = \sum _{y\le k\le x} a_k \big ( g_k \cos L_ku+ g'_k\sin L_k u\big ),{\qquad }x>y\ge 1,\quad u\in \mathbb {R}, \end{aligned}\) where \((g_k)_{k\ge 1}\) , \((g'_k)_{k\ge 1}\) are two independent sequences of i.i.d. \(\mathcal N(0,1)\) distributed random variables. We first study the periodic case \(L_k\equiv k\) . Assume for instance that \(A(x)\sim \log \log x\) , \(x\rightarrow \infty \) and \(B=\sum _{k\ge 1} a_k^4<\infty \) . Let \(0<\eta < 1\) . We prove that there exists an absolute constant C such that for all x large enough, \(\begin{aligned} \mathbb {P}\Big \{ \sup _{0\le t\le 1} X_{1,x}(t) \le \sqrt{2\eta (\log \log x)(\log \log \log x)}\Big \} \ \le \ e^{-\,\frac{C (\log \log x)^{1-\eta }}{ \sqrt{8\eta (B+1)(\log \log \log x)}}}. \end{aligned}\) In the almost periodic case, we prove an approximation theorem. We introduce a modulable diophantine approximation. Let \(N_k\ge k, \ k\ge 1\) be a non-decreasing unbounded test sequence of positive integers, and let \(\ell (k)=\ell (N_k,k)=\frac{1}{N_k}\big \lfloor N_kL_k\big \rfloor \) , so that \(\big |\ell ( k) -L_k\big |\le \frac{1}{N_k}\) , \(k\ge 1\) . Put for any interval I, \( {\kappa }(I)= \#\{{\kappa }: [N_{{\kappa }-1}, N_{\kappa }[\subset I\}\) . We prove an approximation theorem by Gaussian polynomials with \(\mathbb {Q}\) -frequencies, and exponentially decaying error term: for any reals \(\Theta _{y,x}>0\) , \(1\le y\le x\) , \(U\ge 1\) , \(0<h< \Theta _{y,x}\) , \(\begin{aligned} \mathbb {P}\Big \{ \sup _{1\le u\le U} X_{y,x}(u)\le \Theta _{y,x} -h \Big \} \, \le \, \mathbb {P}\Big \{ \sup _{1\le u\le U} X^\perp _{y,x}(u) \le \Theta _{y,x} \Big \} +2\, \exp \Big \{\frac{- C\,h^2 }{ {\Delta }^2 \log {\kappa }([1,U]) } \Big \}, \end{aligned}\) where \(X^\perp _{ y,x}(u) = \sum _{ y\le k\le x} a_k \big ( g_k \cos ( \ell ( k) u) \big ) + g'_k\sin ( \ell ( k) u) \big )\) , \(u\in \mathbb {R}\) , and \({\Delta }\,=\, \sqrt{ \sum _{ y\le k\le x} \frac{1 }{N^2_k } } \sqrt{ \sum _{ y\le k\le x}a_k^2 } +\underset{\underset{N_{\kappa }\le U}{y\le k< {\kappa }}}{\sum } |a_k| + \sup _{ y\le N_{\kappa }\le U }\ N_{\kappa }\sqrt{ \sum _{ {\kappa }\le k\le x} \frac{ 1}{N_k^{2 } } }\, \sqrt{ \sum _{ {\kappa }\le k\le x} |a_k|^2 },\) if \(1\le y\le U\) , and \({\Delta }\,=\,U \sqrt{ \sum _{ y\le k\le x}\frac{1 }{N^2_k } }\sqrt{ \sum _{ y\le k\le x}a_k^2\ }\) , if \(1\le U\le y\) . Finally we study for general non-vanishing coefficient sequences, the behavior along lattices of almost periodic Gaussian polynomials with linearly independent frequencies, and use a lattice localized version of Kronecker’s theorem.