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

Prompt is too long 203073 tokens > 200000 maximum #224

Open
fitchmultz opened this issue Jan 12, 2025 · 2 comments
Open

Prompt is too long 203073 tokens > 200000 maximum #224

fitchmultz opened this issue Jan 12, 2025 · 2 comments

Comments

@fitchmultz
Copy link

Description

When making API requests, receiving a 400 error due to prompt length exceeding maximum token limit.

Error Message

Error in _get_completion: Error code: 400
{'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'prompt is too long: 203073 tokens > 200000 maximum'}}

Expected Behavior

API requests should process successfully within token limits

Current Behavior

Request fails because prompt length (203,073 tokens) exceeds maximum allowed tokens (200,000)

Steps to Reproduce

  1. Make API request with prompt
  2. Receive 400 error due to token limit

Possible Solutions

  1. Reduce prompt length to stay under 200k token limit
  2. Break large prompts into smaller chunks
  3. Implement token counting check before making request

Additional Context

Token limits are a known constraint of the API. Need to implement proper handling.

Labels

  • bug
  • api
  • token-limit
@jasonkneen
Copy link

jasonkneen commented Jan 13, 2025

PR #226

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

No branches or pull requests

3 participants
@jasonkneen @fitchmultz and others