diff --git a/archive/server/continuedev/core/config_utils/shared.py b/archive/server/continuedev/core/config_utils/shared.py index 8508a3cfe..bb845f6c6 100644 --- a/archive/server/continuedev/core/config_utils/shared.py +++ b/archive/server/continuedev/core/config_utils/shared.py @@ -8,7 +8,6 @@ from ...libs.llm.prompts.chat import ( phind_template_messages, template_alpaca_messages, zephyr_template_messages, - flowise_template_messages, ) from ...libs.llm.prompts.edit import ( alpaca_edit_prompt, @@ -17,7 +16,6 @@ from ...libs.llm.prompts.edit import ( phind_edit_prompt, simplest_edit_prompt, zephyr_edit_prompt, - flowise_edit_prompt, ) STEP_NAMES = [ @@ -45,7 +43,7 @@ StepName = Literal[ ] TemplateType = Literal[ - "llama2", "alpaca", "zephyr", "phind", "anthropic", "chatml", "deepseek", "flowise" + "llama2", "alpaca", "zephyr", "phind", "anthropic", "chatml", "deepseek" ] @@ -75,9 +73,6 @@ def autodetect_template_type(model: str) -> Optional[TemplateType]: if "deepseek" in lower: return "deepseek" - if "flowise" in lower: - return "flowise" - return "chatml" @@ -93,7 +88,6 @@ def autodetect_template_function( "anthropic": anthropic_template_messages, "chatml": chatml_template_messages, "deepseek": deepseek_template_messages, - "flowise": flowise_template_messages } return mapping[template_type] return None @@ -117,8 +111,6 @@ def autodetect_prompt_templates( edit_template = alpaca_edit_prompt elif template_type == "deepseek": edit_template = deepseek_edit_prompt - elif template_type == "flowise": - edit_template = flowise_edit_prompt elif template_type is not None: edit_template = simplest_edit_prompt @@ -206,8 +198,6 @@ MODELS = [ "claude-2", # Google PaLM "chat-bison-001", - # Flowise - "flowise", ] ModelName = Literal[ @@ -238,6 +228,4 @@ ModelName = Literal[ "claude-2", # Google PaLM "chat-bison-001", - # Flowise - "flowise", ] diff --git a/archive/server/continuedev/libs/llm/prompts/chat.py b/archive/server/continuedev/libs/llm/prompts/chat.py index 03042e74d..e91fbcdc4 100644 --- a/archive/server/continuedev/libs/llm/prompts/chat.py +++ b/archive/server/continuedev/libs/llm/prompts/chat.py @@ -110,15 +110,6 @@ def phind_template_messages(msgs: List[ChatMessage]) -> str: return prompt -def flowise_template_messages(msgs: List[ChatMessage]) -> str: - prompt = "" - - for msg in messages: - prompt += f"{"Human:" if (msg.role == 'user' or msg.role == 'system') else "Assistant:"} {msg.content} " - - return prompt - - def raw_input_template(msgs: List[ChatMessage]) -> str: return msgs[-1].content diff --git a/archive/server/continuedev/libs/llm/prompts/edit.py b/archive/server/continuedev/libs/llm/prompts/edit.py index 703c1c462..228684193 100644 --- a/archive/server/continuedev/libs/llm/prompts/edit.py +++ b/archive/server/continuedev/libs/llm/prompts/edit.py @@ -113,23 +113,6 @@ _zephyr_edit_prompt = dedent( """ ) -_flowise_edit_prompt = dedent( - """\ - System: - You are an expert programmer and write code on the first attempt without any errors or fillers. - User: - Rewrite the code to satisfy this request: "{{{user_input}}}" - - ``` - {{{code_to_edit}}} - ``` - Assistant: - Sure! Here's the code you requested: - - ``` - """ -) - codellama_edit_prompt = PromptTemplate( prompt=_codellama_edit_prompt, raw=True, stop=["[/CODE]"] @@ -140,4 +123,3 @@ zephyr_edit_prompt = PromptTemplate(prompt=_zephyr_edit_prompt, raw=True, stop=[ deepseek_edit_prompt = PromptTemplate( prompt=_deepseek_edit_prompt, raw=True, stop=["```"] ) -flowise_edit_prompt = PromptTemplate(prompt=_flowise_edit_prompt, raw=True, stop=["```"]) diff --git a/core/index.d.ts b/core/index.d.ts index 0335d20f7..727e5eee7 100644 --- a/core/index.d.ts +++ b/core/index.d.ts @@ -378,8 +378,7 @@ type TemplateType = | "none" | "openchat" | "deepseek" - | "xwin-coder" - | "flowise"; + | "xwin-coder"; type ModelProvider = | "openai" @@ -435,9 +434,7 @@ export type ModelName = // Mistral | "mistral-tiny" | "mistral-small" - | "mistral-medium" - // Flowise - | "flowise"; + | "mistral-medium"; export interface RequestOptions { timeout?: number; diff --git a/core/llm/index.ts b/core/llm/index.ts index 44e47c3cb..286160ea4 100644 --- a/core/llm/index.ts +++ b/core/llm/index.ts @@ -21,7 +21,6 @@ import { anthropicTemplateMessages, chatmlTemplateMessages, deepseekTemplateMessages, - flowiseTemplateMessages, llama2TemplateMessages, openchatTemplateMessages, phindTemplateMessages, @@ -33,7 +32,6 @@ import { alpacaEditPrompt, codellamaEditPrompt, deepseekEditPrompt, - flowiseEditPrompt, mistralEditPrompt, openchatEditPrompt, phindEditPrompt, @@ -100,10 +98,6 @@ function autodetectTemplateType(model: string): TemplateType | undefined { return "openchat"; } - if (lower.includes("flowise")) { - return "flowise"; - } - return "chatml"; } @@ -132,7 +126,6 @@ function autodetectTemplateFunction( deepseek: deepseekTemplateMessages, openchat: openchatTemplateMessages, "xwin-coder": xWinCoderTemplateMessages, - flowise: flowiseTemplateMessages, none: null, }; @@ -169,8 +162,6 @@ function autodetectPromptTemplates( editTemplate = openchatEditPrompt; } else if (templateType === "xwin-coder") { editTemplate = xWinCoderEditPrompt; - } else if (templateType === "flowise") { - editTemplate = flowiseEditPrompt; } else if (templateType) { editTemplate = simplestEditPrompt; } diff --git a/core/llm/templates/chat.ts b/core/llm/templates/chat.ts index 018a1d1bb..b32072f0b 100644 --- a/core/llm/templates/chat.ts +++ b/core/llm/templates/chat.ts @@ -205,19 +205,6 @@ function xWinCoderTemplateMessages(msgs: ChatMessage[]): string { return prompt; } -function flowiseTemplateMessages(messages: ChatMessage[]): string { - const HUMAN_PROMPT = "\n\nHuman:"; - const AI_PROMPT = "\n\nAssistant:"; - let prompt = ""; - - for (const message of messages) { - const role = message.role === "user" || message.role === "system" ? HUMAN_PROMPT : AI_PROMPT; - prompt += `${role} ${message.content} `; - } - - return prompt; -} - export { anthropicTemplateMessages, chatmlTemplateMessages, @@ -228,5 +215,4 @@ export { templateAlpacaMessages, xWinCoderTemplateMessages, zephyrTemplateMessages, - flowiseTemplateMessages }; diff --git a/core/llm/templates/edit.ts b/core/llm/templates/edit.ts index fb774b07c..89ed2ea29 100644 --- a/core/llm/templates/edit.ts +++ b/core/llm/templates/edit.ts @@ -124,20 +124,6 @@ Just rewrite the code without explanations: : \`\`\`{{{language}}}`; -const flowiseEditPrompt = `System: -You are an expert programmer and write code on the first attempt without any errors or fillers. -User: -Rewrite the code to satisfy this request: "{{{userInput}}}" - -\`\`\` -{{{codeToEdit}}} -\`\`\` -Assistant: -Sure! Here's the code you requested: - -\`\`\` -`; - export { alpacaEditPrompt, codellamaEditPrompt, @@ -151,5 +137,4 @@ export { simplifiedEditPrompt, xWinCoderEditPrompt, zephyrEditPrompt, - flowiseEditPrompt, }; diff --git a/core/test/llm.test.ts b/core/test/llm.test.ts index 441550dfb..02b5596ca 100644 --- a/core/test/llm.test.ts +++ b/core/test/llm.test.ts @@ -107,6 +107,6 @@ describe("LLM", () => { // new Mistral({ apiKey: process.env.MISTRAL_API_KEY, model: "mistral-small" }) // ); // testLLM( - // new Flowise({ apiKey: process.env.FLOWISE_API_KEY, model: "flowise" }) + // new Flowise({ apiKey: process.env.FLOWISE_API_KEY, model: "gpt-3.5-turbo" }) // ); }); diff --git a/docs/docs/model-setup/configuration.md b/docs/docs/model-setup/configuration.md index 45b6296e9..4efc6a1b1 100644 --- a/docs/docs/model-setup/configuration.md +++ b/docs/docs/model-setup/configuration.md @@ -54,7 +54,7 @@ However, if neither of these are the case, you will need to wire up a new LLM ob ## Customizing the Chat Template -Most open-source models expect a specific chat format, for example llama2 and codellama expect the input to look like `"[INST] How do I write bubble sort in Rust? [/INST]"`. Continue will automatically attempt to detect the correct prompt format based on the `model`value that you provide, but if you are receiving nonsense responses, you can use the`template`property to explicitly set the format that you expect. The options are:`["llama2", "alpaca", "zephyr", "phind", "anthropic", "chatml", "openchat", "flowise", "none"]`. +Most open-source models expect a specific chat format, for example llama2 and codellama expect the input to look like `"[INST] How do I write bubble sort in Rust? [/INST]"`. Continue will automatically attempt to detect the correct prompt format based on the `model`value that you provide, but if you are receiving nonsense responses, you can use the`template`property to explicitly set the format that you expect. The options are:`["llama2", "alpaca", "zephyr", "phind", "anthropic", "chatml", "openchat", "none"]`. If you want to create an entirely new chat template, this can be done in [config.ts](../customization/code-config.md) by defining a function and adding it to the `templateMessages` property of your `LLM`. Here is an example of `templateMessages` for the Alpaca/Vicuna format: diff --git a/docs/docs/reference/Model Providers/flowise.md b/docs/docs/reference/Model Providers/flowise.md new file mode 100644 index 000000000..d63f77130 --- /dev/null +++ b/docs/docs/reference/Model Providers/flowise.md @@ -0,0 +1,18 @@ +# Flowise + +[Flowise](https://flowiseai.com/) is a low-code/no-code drag & drop tool with the aim to make it easy for people to visualize and build LLM apps. Continue can then be configured to use the `Flowise` LLM class, like the example here: + +```json title="~/.continue/config.json" +{ + "models": [ + { + "provider": "flowise", + "title": "Flowise", + "model": "", + "apiBase": "" + } + ] +} +``` + +[View the source](https://github.com/continuedev/continue/blob/main/core/llm/llms/Flowise.ts) diff --git a/extensions/vscode/config_schema.json b/extensions/vscode/config_schema.json index 9f8c25b8e..bf7f258a4 100644 --- a/extensions/vscode/config_schema.json +++ b/extensions/vscode/config_schema.json @@ -166,8 +166,7 @@ "none", "deepseek", "openchat", - "xwin-coder", - "flowise" + "xwin-coder" ], "type": "string" }, @@ -428,8 +427,7 @@ "codeup-13b", "deepseek-1b", "deepseek-7b", - "deepseek-33b", - "flowise" + "deepseek-33b" ] }, { "type": "string" } @@ -560,8 +558,7 @@ "codeup-13b", "deepseek-1b", "deepseek-7b", - "deepseek-33b", - "flowise" + "deepseek-33b" ] }, { "type": "string" } @@ -599,8 +596,7 @@ "codeup-13b", "deepseek-1b", "deepseek-7b", - "deepseek-33b", - "flowise" + "deepseek-33b" ] }, { "type": "string" } @@ -751,6 +747,42 @@ }, "required": ["key", "value"] } + }, + "model": { + "anyOf": [ + { + "enum": [ + "gpt-3.5-turbo-16k", + "gpt-4", + "gpt-3.5-turbo-0613", + "gpt-4-32k", + "gpt-4-1106-preview", + "mistral-7b", + "mistral-8x7b", + "llama2-7b", + "llama2-13b", + "codellama-7b", + "codellama-13b", + "codellama-34b", + "phind-codellama-34b", + "wizardcoder-7b", + "wizardcoder-13b", + "wizardcoder-34b", + "zephyr-7b", + "codeup-13b", + "deepseek-1b", + "deepseek-7b", + "deepseek-33b", + "claude-2", + "chat-bison-001", + "gemini-pro", + "mistral-tiny", + "mistral-small", + "mistral-medium" + ] + }, + { "type": "string" } + ] } } } diff --git a/gui/src/util/modelData.ts b/gui/src/util/modelData.ts index a0da8c2bc..3dca54e71 100644 --- a/gui/src/util/modelData.ts +++ b/gui/src/util/modelData.ts @@ -412,11 +412,11 @@ const codeup: ModelPackage = { }; const flowise: ModelPackage = { - title: "Flowise", - description: "Open source UI visual tool to build your customized LLM ochestration flow & AI agents", + title: "Flowise (GPT 3.5 Turbo)", + description: "Open source UI visual tool to build your customized LLM ochestration flow & AI agents, using GPT 3.5 Turbo", params: { title: "Flowise", - model: "flowise", + model: "gpt-3.5-turbo", contextLength: 2048, }, icon: "flowiseai.png", diff --git a/schema/json/ModelDescription.json b/schema/json/ModelDescription.json index 9fc9f539e..dd3f5c312 100644 --- a/schema/json/ModelDescription.json +++ b/schema/json/ModelDescription.json @@ -143,8 +143,7 @@ "phind", "anthropic", "chatml", - "deepseek", - "flowise" + "deepseek" ], "type": "string" }, diff --git a/schema/json/ModelName.json b/schema/json/ModelName.json index b43f9b7b0..5dbf93280 100644 --- a/schema/json/ModelName.json +++ b/schema/json/ModelName.json @@ -23,8 +23,7 @@ "deepseek-7b", "deepseek-33b", "claude-2", - "chat-bison-001", - "flowise" + "chat-bison-001" ], "type": "string" } \ No newline at end of file diff --git a/schema/json/SerializedContinueConfig.json b/schema/json/SerializedContinueConfig.json index d96b26d01..b101060e0 100644 --- a/schema/json/SerializedContinueConfig.json +++ b/schema/json/SerializedContinueConfig.json @@ -143,8 +143,7 @@ "phind", "anthropic", "chatml", - "deepseek", - "flowise" + "deepseek" ], "type": "string" },