Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Howto]: reduce token #840

Open
Morphmor opened this issue Apr 3, 2024 · 7 comments
Open

[Howto]: reduce token #840

Morphmor opened this issue Apr 3, 2024 · 7 comments
Labels
question Further information is requested

Comments

@Morphmor
Copy link

Morphmor commented Apr 3, 2024

Version

VisualStudio Code extension

Operating System

MacOS

Your question

It always get stuck and give me that error. Is there a way to increase the tokens taht can be used for this step ?
Is Gpt-pilot always sending the full code including all files with every step end every request? Can i somehow tell Gpt-pilot to only send the needed information for the present task?

Error calling LLM API: The request exceeded the maximum token limit (request size: 8237) tokens.

--------- LLM Reached Token Limit ----------
Can I retry implementing the entire development step?

@Morphmor Morphmor added the question Further information is requested label Apr 3, 2024
@neffetzz
Copy link

neffetzz commented Apr 3, 2024

Hi,
I think, I had the same problem like @Morphmor.

I'm using Anthropic as LLM-Server. It works fine untill I get the Error 429.
Error 429 means that:

"...Number of request tokens has exceeded your rate limit (https://docs.anthropic.com/claude/reference/rate-limits). Please reduce the the prompt length or the maximum tokens requested, or try again later..."

I set MAX_TOKENS=4096.

Any ideas or suggestions?

@Wladastic
Copy link

You may have to rewrite a couple of prompts for this.
Try increasing the context length in your llm to at least 17k.
The code for doing requests is faulty as well, there is no truncation length given to the llm api, which means that if your AI has the token limit of 8k and receives 7k, it will still try to produce more.
You can reduce this behaviour by setting the max_new_tokens to 1024 or 2048 for example.

Do not reduce MAX_TOKENS to 4096 as this makes gpt-pilots prompts nearly unusable.
If you give your ai 1500 tokens as system prompt, then 8000 tokens context, then it is supposed to respond in 2048 tokens and 600 tokens at least, you will already reach the limit every time.

@invisiblepancake
Copy link

invisiblepancake commented Apr 3, 2024

it was having python enviorment. made sude to root p to the project root directory. not one slip out of there? noh worries looking thru manuals to an pearl command sorted sciprts etc =)

poetry scripts/setup | from ur gpt`d dir

@neffetzz
Copy link

neffetzz commented Apr 3, 2024

Hi @Wladastic ,
thank you for your comment. I set the Parameter „max_new_token=1024“ and gpt-pilot was able to create the First app.👌

@invisiblepancake
Copy link

if ur using apple hardware.... ive having issues with preinstalled plingdows to get elevated pric for scrape install etc

@invisiblepancake
Copy link

try getting an workstation with none preinstalled like anything rly. and build an linux os env =)

@neffetzz
Copy link

neffetzz commented Apr 5, 2024

Hi,

Pythagora works best on my PC with the Anthropic API when I'm using the following .env settings:

/###########################################################################
## ANTHROPIC ##
ANTHROPIC_API_KEY=sk-ant-1111-11111111111111111111111111111111111111
ANTHROPIC_ENDPOINT=
MODEL_NAME=anthropic/claude-3-haiku-20240307
MAX_TOKENS=4096
MAX_NEW_TOKENS=1024 
###########################################################################

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants