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

BUG: API /completion endpoint returns 500 (server error) when sending "max_token" = 1 #122

Open
MrXavier opened this issue Jan 23, 2024 · 0 comments

Comments

@MrXavier
Copy link

MrXavier commented Jan 23, 2024

While I was playing with the API endpoint /completion I found out a bug with the "max_tokens" body field when it's set to 1. Instead of returning 1 token response or a validation error, it returns 500 (internal server error).

If 1 token response is not allowed I believe it should return 400 bad request with the accepted boundaries for the max_token value.

Here is an example of request using curl:

curl --location "https://api.mistral.ai/v1/chat/completions" \
     --header 'Content-Type: application/json' \
     --header 'Accept: application/json' \
     --header "Authorization": Bearer {XXXY} \
     --data '{
    "model": "mistral-tiny",
    "messages": [
     {
        "role": "user",
        "content": “Prompt here…”
      }
    ],
    "max_tokens": 1
  }'
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

1 participant