If a sequence grows too fast, then its harmonic sum cannot be rational
An example that appears to be at the cusp is Sylvester's sequence:
$$a_0 = 2, \,\,\, a_n = 1 + \prod_{k=0}^{n-1}a_k = 1+ a_{n-1}(a_{n-1} -1),$$
with the closed form $a_n = \lfloor C^{2^{n+1}} + \frac{1}{2} \rfloor$ with $C \approx 1.26$ and a doubly exponential growth rate.
The sum is rational with
$$\sum_{n=0}^\infty \frac{1}{a_n} = 1,$$
since,
$$ \frac{1}{a_{n+1} - 1} = \frac{1}{a_n(a_n - 1)} = \frac{1}{a_n - 1} - \frac{1}{a_n}\\ \implies \frac{1}{a_n} = \frac{1}{a_n - 1} - \frac{1}{a_{n+1} - 1} $$
Addendum
Although now deleted, the comment to my answer from @charMD cited theorem 3 in 128p of https://www.renyi.hu/~p_erdos/1963-18.pdf
where it is proved that if $a_{n+1} \geqslant 1 + a_n(a_n - 1)$ and strictly greater for infinitely many $n$ then $\sum(1/a_n)$ is irrational.
Adam Hughes essentially answers the question in the comments. Namely, if $a_n>\exp(\prod_{i<n} a_i),$ then by Liouville's lemma, your sum is transcendental (hence, irrational), so doubly exponential growth is sufficient.However, since all you want is irrationality, you can apply the actual statement of Liouville's lemma to remove the $\exp,$ and have $a_n>(\prod_{i<n} a_i)^{(1+\epsilon)},$ for some $\epsilon > 0.$
If a number is rational, say $\frac{p}{q}$, then $\left|\frac{p}{q}-\frac{m}{n}\right|\geq\frac{1}{nq}$. So the difference from any test rational $\frac{m}{n}$ times the denominator $n$ has to be bounded below unless you hit your number spot on. If we find an increasing sequence of rational numbers for which that is not the case, then the limit is irrational.
So assuming the sequence grows as fast as a geometric series (that's a reasonable enough assumption of growth) so that the sum can be estimated by the next term, if you have $\frac{\text{lcm}(a_1, \ldots a_n)}{a_{n+1}}\rightarrow0$ as $n\rightarrow\infty$, then the sum $\sum_{i=1}^{\infty}\frac{1}{a_i}$ is irrational.
These cover the two cases in your question, though neither is doubly exponential. It even shows that $e$ is irrational. But it doesn't quite answer the question. It does, however, provide a set of $f(i)$'s that are good enough. Specifically, we can let $f(i)$ be a sequence for which $f(i)^{1/2^i}$ increases to $\infty$. Because if we have a sequence of $a_i>f(i)$, then for any $\epsilon$ we take the smallest $i$ for which $a_i>\left(\frac{1}{\epsilon}\right)^{2^{i-1}}$ which exists; then
$\frac{\text{lcm}(a_1,a_2,\ldots a_{i-1})}{a_i}<\frac{a_1a_2\ldots a_{i-1}}{a_i}<\frac{\left(\frac{1}{\epsilon}\right)^1\left(\frac{1}{\epsilon}\right)^2\ldots\left(\frac{1}{\epsilon}\right)^{2^{i-2}}}{\left(\frac{1}{\epsilon}\right)^{2^{i-1}}}=\epsilon$
And this is good enough, because we only need a subsequence of the above to tend to 0, not the entire sequence. So for any sequence $u(i)$ increasing to infinity, $u(i)^{2^i}$ works.