Readit News logoReadit News
lsb commented on Show HN: I replaced vector databases with Git for AI memory (PoC)   github.com/Growth-Kinetic... · Posted by u/alexmrv
lsb · 2 days ago
Interesting! Text files in git can work for small sizes, like your 100MB.

That is what's known in FAISS as a "flat" index, just one thing after another. And obviously you can query by primary key to the key-value store that is git, and do atomic updates as you'd expect. In SQL land this is an unindexed column, you can do primary key lookups on the table, or you can look through every row in order to find what you want.

If you don't need fast query times, this could work great! You could also use SQL (maybe an AWS Aurora Postgres/MySQL table?) and stuff the fact and its embedding into a table, and get declarative relational queries (find me the closest 10 statements users A-J have made to embedding [0.1, 0.2, -0.1, ...] within the past day). Lots of SQL databases are getting embedding search (Postgres, sqlite, and more) so that will allow your embedding search to happen in a few milliseconds instead of a few seconds.

It could be worth sketching out how to use SQLite for your application, instead of using files on disk: SQLite was designed to be a better alternative to opening a file (what happens if power goes out while you are writing a file? what happens if you want to update two people's records, and not get caught mid-update by another web app process?) and is very well supported by many language ecosystems.

Then, to take full advantage of vector embedding engines: what happens if my embedding is 1024 dimensions and each one is a 32 bit floating point value? Do I need to save all of that precision? Is 16-bit okay? 8-bit floats? What about reducing the dimensionality? Is it good enough accuracy and recall if I represent each dimension with an index to a palette of the best 256 floats for that dimension? What about representing each pair of dimensions with an index to a palette of the best 256 pairs of floats for those two dimensions? What about, instead of looking through every embedding one by one, we know that people talk about one of three different topics, and we have three different indices for each of those major topics, and to find your nearest neighbors you want to first find your closest topic (or maybe closest two topics?) and then search in those lower indices? Each of these hypotheticals is literally a different “index string” in an embedding search called FAISS, and could easily be thousands of lines of code if you did it yourself.

It’s definitely a good learning experience to implement your own embedding database atop git! Especially if you run it in production! 100MB is small enough that anything reasonable is going to be fast.

lsb commented on Gemma 3 270M re-implemented in pure PyTorch for local tinkering   github.com/rasbt/LLMs-fro... · Posted by u/ModelForge
lsb · 3 days ago
That’s wild that with a KV cache and compilation on the Mac CPU you are faster than on an A100 GPU.
lsb commented on Vendors that treat single sign-on as a luxury feature   sso.tax/... · Posted by u/vinnyglennon
lsb · 4 days ago
Also: this SSO tax is deceptively framed. Many of these services allow one to sign in through, for example, Google, which can count as a single sign on, and many organizations have a mail account, but that isn’t taken into account.
lsb commented on What's the strongest AI model you can train on a laptop in five minutes?   seangoedecke.com/model-on... · Posted by u/ingve
lsb · 9 days ago
This is evocative of “cramming”, a paper from a few years ago, where the author tried to find the best model they could train for a day on a modern laptop: https://arxiv.org/abs/2212.14034
lsb commented on Ask HN: With all the AI hype, how are software engineers feeling?    · Posted by u/cpt100
lsb · 13 days ago
I used Claude Code to navigate a legacy codebase the other day, and having the ability to ask "how many of these files have helper methods that are duplicated or almost but not quite exactly duplicated?" was very much a superpower.
lsb commented on Ask HN: Moving a not-for-profit web app off AWS    · Posted by u/sjayasinghe
lsb · 7 months ago
I’ve been running half-a-billion parameter models comfortably in a web browser, especially with WebGPU, and you can definitely run billion parameter LLMs in the browser. It becomes a heavyweight browser app, but if the main costs are running ML models you can pretty easily serve static files from a directory and let clients’ browsers do the heavy lifting. Feel free to reach out if you have questions, happy to help, I’ve been working on language web apps as well
lsb commented on Ask HN: What's the most creative 'useless' program you've ever written?    · Posted by u/reverseCh
lsb · 10 months ago
I made an AI Art clock, using Stable Diffusion to render a 24-hour clock face into a landscape: https://leebutterman.com/diffusion-local-time/
lsb commented on Fast B-Trees   scattered-thoughts.net/wr... · Posted by u/surprisetalk
lsb · a year ago
Clojure, for example, uses Hash Array Mapped Tries as its associative data structure, and those work well
lsb commented on 48% of NYC riders do not pay the bus fare   nytimes.com/2024/08/26/ny... · Posted by u/paulpauper
lsb · a year ago
All New Yorkers pay 80% of the cost to run the bus before they even think about boarding. (“Farebox recovery ratio”)

This is an excuse to fund more cops. Transit should be free, like sidewalks and parks.

u/lsb

KarmaCake day4078August 22, 2007
About
classicist, computer scientist, founder of PoetaExMachina and NoDictionaries, biker around Oakland

leebutterman@gmail.com

View Original