There aren't that many packages - as of 10/21/26 packages.gleam.run says 1712 packages are available.
Of those packages, many are slop or superseded, let's say there are only around 200-800 good packages.
ChatGPT estimates 50KB of text per Gleam package, maybe 1430 lines * 35 bytes/line. That might be too low, but imo package quality is inversely correlated with size. There are exceptions, eg if lustre wants to use 20k lines of code sure it's doing a lot, but generally good libraries "do one thing well"; big libraries trying to do everything in the world, so much you can't even understand what it's for, are a some kind of prepsychosis imo (althoug I do like layered APIs)
One case that can really upset average size, packages of Gleam bindings to some giant API, should be excluded. The right design for Gleam is a code generator that lets the user create code for only the parts of the API they need (for fhir I originally made this mistake and generated types, decoders, etc for all ~150 resources...now I'm trying to make it so user can generate only what's in their profile). And for text search you might want the output of code generator, not generator itself (well, you might want some random utility fn or something from the generator itself; idk what you want).
So let's say 10MB - 40MB of text. However to make text nicely searchable with FTS5 the index will, per ChatGPT, maybe take 100% of the size of the original text, so double it to 20MB-80MB.
And between I don't know what I'm talking about + AI who knows, let's say fudge factor of 1-25, so 20MB-2000MB.
2000MB = 2GB is kind of a lot but still even in this worst case, ChatGPT mentions Origin-Private FileSystem as a solution. I don't know what OFPS is and ideally we wouldn't need it, but maybe if needed it would be there.
Of course over time people will publish more Gleam packages so maybe eventually this will not be feasible — for instance, you probably couldn't fit all the Python packages in browser — but again not all packages are good; packages |> list.filter(I like it) hopefully won't grow too big anytime soon. (and if Gleam has 5,000 awesome packages, that's a good problem to have)
Sometimes I get bored and read what's new on packages.gleam.run, just out of curiousity, it's better than reading reddit and rotting. It might be nice to have a list of packages more filtered by if I actually like them and searchable for types/functions similar to gloogle.
Putting it in the browser has one big advantage which is it's a lot easier/cheaper to store a static file, which SQLite database is, than get hosting for an application. For example Cloudflare currently offers 10GB storage free.
It also means no latency when user makes request, but this is not necessarily overall positive because they have to download whole database first, which might be bad depending on power of their device and speed/quality of their connection.
It might be overengineered, idk, I kind of just want to try SQLite in browser. Plus easy/cheap to host is a big plus.