From f3e9b03de6416edb71ef9a74d3113d0d996d2d88 Mon Sep 17 00:00:00 2001 From: Roger Meier Date: Thu, 18 Apr 2024 21:42:32 +0200 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20set=20supportsCompletions=20?= =?UTF-8?q?based=20on=20useLegacyCompletionsEndpoint=20model=20setting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #1132 --- core/llm/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/llm/index.ts b/core/llm/index.ts index ed920eaa7..6831ad475 100644 --- a/core/llm/index.ts +++ b/core/llm/index.ts @@ -52,7 +52,8 @@ export abstract class BaseLLM implements ILLM { if (this.providerName === "openai") { if ( this.apiBase?.includes("api.groq.com") || - this.apiBase?.includes(":1337") + this.apiBase?.includes(":1337") || + this._llmOptions.useLegacyCompletionsEndpoint?.valueOf() === false ) { // Jan + Groq don't support completions : ( return false; From e571e1c821f0a8736800b676c4785fe3a366a45e Mon Sep 17 00:00:00 2001 From: Roger Meier Date: Thu, 18 Apr 2024 22:00:07 +0200 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=9D=20useLegacyCompletionsEndpoint?= =?UTF-8?q?=20within=20OpenAI=20docs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/docs/reference/Model Providers/openai.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/docs/reference/Model Providers/openai.md b/docs/docs/reference/Model Providers/openai.md index 853d97b43..c15f88b63 100644 --- a/docs/docs/reference/Model Providers/openai.md +++ b/docs/docs/reference/Model Providers/openai.md @@ -52,4 +52,10 @@ If you are [using an OpenAI compatible server / API](../../model-setup/select-pr } ``` +To force usage of `chat/completions` instead of `completions` endpoint you can set + +```json +"useLegacyCompletionsEndpoint": false +``` + [View the source](https://github.com/continuedev/continue/blob/main/core/llm/llms/OpenAI.ts)