A generating set for a finite group G is said to be minimal if no proper subset generates G, and m(G) denotes the maximal size of a minimal generating set for G. We prove a conjecture of Lucchini, Moscatiello and Spiga by showing that there exist a,b>0 such that any finite group G satisfies m(G)≤a⋅δ(G)b, for \delta(G) = \sum_{\text{p prime}} m(G_p) where Gp is a Sylow p-subgroup of G. To do this, we first bound m(G) for all almost simple groups of Lie type (until now, no nontrivial bounds were known except for groups of rank 1 or 2). In particular, we prove that there exist a,b>0 such that any finite simple group G of Lie type of rank r over the field Fpf satisfies r+ω(f)≤m(G)≤a(r+ω(f))b, where ω(f) denotes the number of distinct prime divisors of f. In the process, we confirm a conjecture of Gill and Liebeck that there exist a,b>0 such that a minimal base for a faithful primitive action of an almost simple group of Lie type of rank r over Fpf has size at most arb+ω(f).