continuedev / continue

⏩ Continue is the leading open-source AI code assistant. You can connect any models and any context to build custom autocomplete and chat experiences inside VS Code and JetBrains
https://docs.continue.dev/
Apache License 2.0
16.64k stars 1.3k forks source link

tabAutocompleteModel raise http 400 with litellm #1572

Closed goodosoft closed 3 months ago

goodosoft commented 3 months ago

Before submitting your bug report

Relevant environment info

- OS: macOS 14.5
- Continue: v0.8.40
- IDE: Visual Studio Code 1.90.2

{"error":{"message":"litellm.BadRequestError: BadRequestError: OpenAIException - Error code: 400 - {'error': {'message': \"Invalid 'stop': array too long. Expected an array with maximum length 4, but got an array with length 14 instead.\", 'type': 'invalid_request_error', 'param': 'stop', 'code': 'array_above_max_length'}}","type":null,"param":null,"code":400}}

Description

{"error":{"message":"litellm.BadRequestError: BadRequestError: OpenAIException - Error code: 400 - {'error': {'message': \"Invalid 'stop': array too long. Expected an array with maximum length 4, but got an array with length 14 instead.\", 'type': 'invalid_request_error', 'param': 'stop', 'code': 'array_above_max_length'}}","type":null,"param":null,"code":400}}

To reproduce

No response

Log output

{"error":{"message":"litellm.BadRequestError: BadRequestError: OpenAIException - Error code: 400 - {'error': {'message': \"Invalid 'stop': array too long. Expected an array with maximum length 4, but got an array with length 14 instead.\", 'type': 'invalid_request_error', 'param': 'stop', 'code': 'array_above_max_length'}}","type":null,"param":null,"code":400}}
sestinj commented 3 months ago

@goodosoft This is an edge case we haven't considered largely because GPT-4 isn't intended for autocomplete. Do you have access to any other models, like Codestral? It will be cheaper, faster, more accurate, give correct formatting, and won't cause this problem

goodosoft commented 3 months ago

@goodosoft This is an edge case we haven't considered largely because GPT-4 isn't intended for autocomplete. Do you have access to any other models, like Codestral? It will be cheaper, faster, more accurate, give correct formatting, and won't cause this problem

Thanks, we will try Codestral with ollama.

goodosoft commented 3 months ago

use Cloudflare Workers AI as tabAutocompleteModel, it works. But sometimes show <|end▁of▁sentence|> .

1630