Live data from Hacker News

Show HN: GPT Repo Loader – load entire code repos into GPT prompts

github.com

41–50 of 162 posts

Re: Show HN: GPT Repo Loader – load entire code repos into GPT prompts

#41
post #39

Earlier quoted context omitted.

Just remember the API charge is 6c per input token [1]. If you push 32k input tokens in, you're looking at $2000 per API call just as input. You... might wanna consider a self hosted alternative for that use case, or at least do like, a `| wc` to get an idea of what you're potentially sending before calling the api. [1] - https://help.openai.com/en/articles/7127956-how-much-does-gp...

6c per thousand tokens, so $2 per maxed out API call

oh, you're quite right, I didn't see that it was per /1k tokens. My bad!

Re: Show HN: GPT Repo Loader – load entire code repos into GPT prompts

#43

Rather than prompting GPT into implementing a solution, can we prompt it to try to preemptively find issues with the codebase or missing-functionality? Also, do we know what languages GPT-4 "understands" at a sufficient level? What knowledge does it have of post-2021 language features, like in C23?

I imagine few shot learning would kick in for most new language features. A feature may be new to a particular language, but is it really new?

I tried a new Lisp dialect on it, my own hobby language. It could cope well given explanations initially, but with some degradation after a while. The full transcript went to 84kB, so it must be doing some kind of intelligent summarization behind the scenes to stay as coherent as it did, right? (The standard context window is supposed to be 8k tokens.)

(https://gist.github.com/darius/b463c7089358fe138a6c29286fe2d... paste in painful-to-read format if anyone's really curious. In three parts: intro to language; I ask it to code symbolic differentiation; then a metacircular interpreter.)

Re: Show HN: GPT Repo Loader – load entire code repos into GPT prompts

#46
post #15
post #13

Eventually you get to a point where the AI simply doesn’t know how to do something correctly. It can’t fix a certain bug, or implement a feature correctly. At this point you are left trying to do more and more prompt crafting… or you can just fix the problem yourself. If you can’t do it yourself, you’re screwed. I wonder if the future will just be software hobbled together with shitty AI code that no one understands,…

> I wonder if the future will just be software hobbled together with shitty AI code that no one understands, with long loops and deep call stacks and abstractions on top of abstractions There's plenty of software out there that fits this description if you just remove "AI" from the statement. There's nothing new about bad codebases. Now it just costs pennies and is written in seconds instead of thousands paid to an o…

At least the shitty software might have unit tests

Re: Show HN: GPT Repo Loader – load entire code repos into GPT prompts

#47
post #31

Earlier quoted context omitted.

Between GPT-3 and GPT-4 the precision required for prompts was decreased significantly. In theory it should reach the point where a project manager type person would be able to describe what is needed and it would simply do it, the main thing missing from attaining that is that GPT-4 basically never responds to questions with requests for clarification, otherwise, a whole team of developers could be reduced to just o…

That’s not very impressive. With very little precision I can throw a few keywords into google and get a full answer and perhaps some code snippets from stack overflow to solve whatever problem I have in the moment. Except you can’t just blindly copy code snippets, you have to read the author’s explanation and perhaps adapt things to your own code sometimes, or reject their solution entirely. GPT-4 can’t do this becau…

> That’s not very impressive.

That’s kind of impressive.

I usually have zero luck with stack overflow except for super trivial things.

Some of the stuff I’ve done has no documentation and I had to find an example (like one other person in the entire history of mankind though this was a good idea) on some random repo on GitHub. Or I’m implementing code from a paper written 30 or 40 years ago and there’s no example code to look at. I could ask on stack overflow but who needs that abuse?

Admittedly I just do this to amuse myself and think that having a LLM digest a paper and spit out code is the bee’s knees.

Re: Show HN: GPT Repo Loader – load entire code repos into GPT prompts

#49
post #33

Before anyone working on commercial code bases thinks to use this, stop. Uploaded code becomes part of OpenAI.

This is not true anymore, they changed their terms so this is now opt in.

It's still probably extemely against any reasonable business's code of conduct.

Re: Show HN: GPT Repo Loader – load entire code repos into GPT prompts

#50
post #3

How much text can you feed GPT-4? Our codebase is 1 million lines of code. Can we feed the documentation to it? What are the limits? Is it possible to train it on our data without doing prompt engineering? How? Otherwise are we supposed to use embeddings? Can someone explain how these all work and the tradeoffs?

For an alternative, you can use LangChain.

Unfortunately GPT is not yet aware of what LangChain is or how it works, and the docs are too long to feed the whole thing to GPT.

But you can still ask it to figure something out for you.

For example: “write pseudo-code that can read documents in chunks of 800 tokens at a time, then for each chunk create a prompt for GPT to summarize the chunk, then save the responses per document and finally aggregate+summarize all the responses per document”

Basically a kind of recursive map/reduce process to get, process and aggregate GPT responses about the data.

LangChain provides tooling to do the above and even allow the model to use tools, like search or other actions.

Post reply on HN