gpt-pilot icon indicating copy to clipboard operation
gpt-pilot copied to clipboard

[Bug]: Token Error Limit

Open Captain-Bacon opened this issue 1 year ago • 2 comments

Version

VisualStudio Code extension

Operating System

MacOS

What happened?

This has been a problem I've always seemed to have with GPT-Pilot, and I hope there's a workaround?

I always seem to end up hitting a token limit. It's always at the same kind of point in the dev cycle (each project is a different point, but it always seems to break at around the same point).

In this instance:

"gpt-pilot/pilot/utils/llm_connection.py", line 219, in wrapper raise TokenLimitError(get_tokens_in_messages_from_openai_error(err_str), MAX_GPT_MODEL_TOKENS)

helpers.exceptions.TokenLimitError.TokenLimitError: Token limit error happened with 264655/8192 tokens in messages!

Yeah, that's a lot of tokens over the limit! I'm not doing anything weird or wonderful, just a react webapp. In this most recent example it's before what would be getting the sockets set up for i/o.

Is there anything that can be done? I noticed that Tiktoken is on the installed list, but it doesn't seem to be able to catch this before it makes the attempt and exits-with-error.

TIA!

Captain-Bacon avatar Dec 27 '23 01:12 Captain-Bacon

This is likely because we're sending the full directory strucutre/contents to the LLM so it knows where to make the changes.

We're working on selecting only appropriate files (for the task at hand) for the context, which should lower the token count, decrease the cost, and make GPT Pilot faster.

senko avatar Dec 27 '23 10:12 senko

Possible duplicate of #419

senko avatar Dec 28 '23 15:12 senko

Senko yall boys lit, love the software -AngelBoy

AngelBoyGo avatar Jan 07 '24 21:01 AngelBoyGo

Hi @senko,

Thanks for your work. Do you see any ETA on this? I am constantly bumping into the token limit error before even starting any development in react native. Selecting the important files to send would be a huge improvement. Currently I can not even move to the first dev steps after setting up the react env and installations.

Cheers

Zol1Magyar avatar Feb 02 '24 10:02 Zol1Magyar

@Zol1Magyar this might be helpful: https://www.youtube.com/watch?v=GMch80e69nQ

senko avatar Feb 03 '24 18:02 senko