It's not about how much money, but rather how to spend it. Well, okay, to spend money some way you first need it, but the amount could be quite small.
Most of the knowledge is already available online for free. (There are still some gaps that would be nice to fill, for example lessons for small kids whose first language is not English.) The problem is rather navigating the abundance of information.
First, to distinguish genuine knowledge from crackpottery. Like, most of us probably know that 99% of videos on YouTube containing "quantum" in their titles are pure nonsense. But a smart 13 years old kid doesn't know that yet, and can waste a lot of time gaining negative knowledge (misconceptions that later require time and work to unlearn). We know that in case of doubt, the materials published by MIT are most likely solid. For that kid, even this is not necessarily obvious; it would be better to tell them explicitly.
Second, lessons have prerequisites. I can find an interesting lesson, only to realize that I actually can't follow it, because it uses symbols and concepts I don't understand, and I don't even know how that missing part of knowledge is called. It would be great to have some guidance of form "you can learn X by watching Y, but first you need to understand M and N which you can learn by watching P and Q, etc.". A tech-tree of knowledge, kind of.
For these two things, you don't actually need a school system. A website could be enough: a page for each topic, internal links to prerequisite topics, external links for educational resources checked for quality. You would need some budget for this, but I assume that for costs similar to running one school, you could serve the entire nation. -- And it wouldn't be only for the smart kids; the average kids could use it, too. Everyone could progress at their own speed. Actually, it would be even better if all the kids would use it, because then you wouldn't have to look specifically for the smart kids and advertise it to them, they would simply learn about it from kids around them.
Now you can add extra services, like a silent place to go study if you don't have such place at home, a computer with an internet connection is you don't have one at home. Places to meet people studying the same topic. Etc. This all would be nice to have. I am just saying that the minimum solution that could help maybe 80% of gifted kids could actually be made very cheaply.