Live data from Hacker News

Show HN: Badge that shows how well your codebase fits in an LLM's context window

github.com

41–47 of 47 posts

Re: Show HN: Badge that shows how well your codebase fits in an LLM's context window

#41
post #26

Maybe it’s useful to dig out the concept of modularization with a distinction between interface and implementation again, and construct agents that are able to make effective use of it. In the case that interfaces remain unchanged, agents only need to look at the implementation of a single module at a time plus the interfaces it consumes and implements. And when changing interfaces, agents only need to look at the in…

functional programming get recked, OOP is back, baby!

This is orthogonal to that. Interfaces are types, implementations are lambda bodies. There you go.

Re: Show HN: Badge that shows how well your codebase fits in an LLM's context window

#44
post #25
post #22

Earlier quoted context omitted.

It’s interesting but I think it’s measuring the wrong thing. Abstraction is a fundamental principle in software. As a human, I’ve worked with classes and modules far larger than what fits in my head, just because I’m only fitting the function signatures and purpose into my head, and not the implementation details. In practice I find Claude really good at extracting useful information in a human-like way from a codeba…

Also this rewards dynamic languages over typed languages, penalizes comments, descriptive function names, etc. Though frankly, it'd be interesting to see whether AI would work better with a project in Javascript that barely fits in context, or the same thing in typescript that overflows. I could imagine either, but my guess is "it depends". Though, "depends on what" would be interesting to know. Still, this seems use…

Never thought about the impact of comments, perhaps there is value in stripping those out of read file tools

Re: Show HN: Badge that shows how well your codebase fits in an LLM's context window

#45

On a related note, this type of reasoning is what made me flip my opinion on microservices. I've generally been skeptical of a many-microservice architecture for the last decade but LLMs change that - a small microservice is more likely to fit in a context window. I think this gestures at a more general point - we're still focusing on how to integrate LLMs into existing dev tooling paradigms. We squeeze LLMs into IDE…

They don't need to be services. You can - and many projects do - structure your code as a set of loosely coupled modules. Each module has a responsibility or set of responsibilities. They communicate with each other via well defined interfaces. For exposing code like this to an LLM, you would have them make a change to one or sometimes two modules, with access to the interface docs of all the other modules. The disadvantage of this compared to microservices is that if a module crashes it will take the entire process down with it, you can't move a module onto a different machine or create multiple instances of it as easily, etc. The advantage is that communication is done via function calls, which are simpler and more efficient than rpc.

> I think this gestures at a more general point - we're still focusing on how to integrate LLMs into existing dev tooling paradigms.

This is what we should be doing. This for a couple reasons. For one thing, humans don't have an entire codebase "in context" at a time. We should be recognizing that the limitations of an AI mirror the limitations of a person, and hence can have similar solutions. For another, the limitations of today's LLMs will not be the limitations of tomorrow's LLMs. Redesigning our code to suit today's limitations will only cause us trouble down the road.

Re: Show HN: Badge that shows how well your codebase fits in an LLM's context window

#47
Hi, i just open sourced my alternative at https://github.com/janwilmake/forgithub.badge, which is backed by uithub.com. The advantage is that you don't need a github action to calculate and it still auto-updates daily; also, if you click, you go to uithub to further trim the context window which can be useful if the whole codebase doesn't fit or if you want higher quality outputs.
Post reply on HN