From 94d8d39cfc8d21f2544633330370d99ef17e0fdf Mon Sep 17 00:00:00 2001 From: vercel Date: Mon, 23 Dec 2024 14:23:04 +0800 Subject: [PATCH 1/6] feat: add novita info --- CONTRIBUTING.md | 4 +- core/llm/autodetect.ts | 2 + core/llm/llms/Novita.ts | 53 +++++++++++++++++++ core/llm/llms/index.ts | 2 + docs/docs/chat/model-setup.mdx | 14 ++++- .../customize/model-providers/more/novita.md | 18 +++++++ docs/docs/customize/tutorials/llama3.1.md | 24 ++++++++- docs/docusaurus.config.js | 6 ++- .../current/chat/model-setup.mdx | 14 ++++- .../customize/model-providers/more/novita.md | 18 +++++++ .../current/customize/tutorials/llama3.1.md | 23 +++++++- extensions/vscode/config_schema.json | 46 +++++++++++++++- gui/src/pages/AddNewModel/configs/models.ts | 8 ++- .../pages/AddNewModel/configs/providers.ts | 36 ++++++++++++- packages/openai-adapters/README.md | 1 + packages/openai-adapters/src/index.ts | 2 + packages/openai-adapters/src/types.ts | 1 + packages/openai-adapters/test/main.test.ts | 6 +++ 18 files changed, 266 insertions(+), 12 deletions(-) create mode 100644 core/llm/llms/Novita.ts create mode 100644 docs/docs/customize/model-providers/more/novita.md create mode 100644 docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/more/novita.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ca26d38fe4..843f5ad171 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -188,7 +188,7 @@ After you've written your context provider, make sure to complete the following: ### Adding an LLM Provider -Continue has support for more than a dozen different LLM "providers", making it easy to use models running on OpenAI, Ollama, Together, LM Studio, Msty, and more. You can find all of the existing providers [here](https://github.com/continuedev/continue/tree/main/core/llm/llms), and if you see one missing, you can add it with the following steps: +Continue has support for more than a dozen different LLM "providers", making it easy to use models running on OpenAI, Ollama, Together, Novita, LM Studio, Msty, and more. You can find all of the existing providers [here](https://github.com/continuedev/continue/tree/main/core/llm/llms), and if you see one missing, you can add it with the following steps: 1. Create a new file in the `core/llm/llms` directory. The name of the file should be the name of the provider, and it should export a class that extends `BaseLLM`. This class should contain the following minimal implementation. We recommend viewing pre-existing providers for more details. The [LlamaCpp Provider](./core/llm/llms/LlamaCpp.ts) is a good simple example. @@ -209,7 +209,7 @@ While any model that works with a supported provider can be used with Continue, 1. Add a `ModelPackage` entry for the model into [configs/models.ts](./gui/src/pages/AddNewModel/configs/models.ts), following the lead of the many examples near the top of the file 2. Add the model within its provider's array to [AddNewModel.tsx](./gui/src/pages/AddNewModel/AddNewModel.tsx) (add provider if needed) - [index.d.ts](./core/index.d.ts) - This file defines the TypeScript types used throughout Continue. You'll find a `ModelName` type. Be sure to add the name of your model to this. -- LLM Providers: Since many providers use their own custom strings to identify models, you'll have to add the translation from Continue's model name (the one you added to `index.d.ts`) and the model string for each of these providers: [Ollama](./core/llm/llms/Ollama.ts), [Together](./core/llm/llms/Together.ts), and [Replicate](./core/llm/llms/Replicate.ts). You can find their full model lists here: [Ollama](https://ollama.ai/library), [Together](https://docs.together.ai/docs/inference-models), [Replicate](https://replicate.com/collections/streaming-language-models). +- LLM Providers: Since many providers use their own custom strings to identify models, you'll have to add the translation from Continue's model name (the one you added to `index.d.ts`) and the model string for each of these providers: [Ollama](./core/llm/llms/Ollama.ts), [Together](./core/llm/llms/Together.ts), [Novita](./core/llm/llms/Novita.ts), and [Replicate](./core/llm/llms/Replicate.ts). You can find their full model lists here: [Ollama](https://ollama.ai/library), [Together](https://docs.together.ai/docs/inference-models), [Novita](https://novita.ai/llm-api?utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=link), [Replicate](https://replicate.com/collections/streaming-language-models). - [Prompt Templates](./core/llm/index.ts) - In this file you'll find the `autodetectTemplateType` function. Make sure that for the model name you just added, this function returns the correct template type. This is assuming that the chat template for that model is already built in Continue. If not, you will have to add the template type and corresponding edit and chat templates. ### Adding Pre-indexed Documentation diff --git a/core/llm/autodetect.ts b/core/llm/autodetect.ts index 226102e885..2a9986e6cb 100644 --- a/core/llm/autodetect.ts +++ b/core/llm/autodetect.ts @@ -41,6 +41,7 @@ const PROVIDER_HANDLES_TEMPLATING: string[] = [ "openai", "ollama", "together", + "novita", "msty", "anthropic", "bedrock", @@ -130,6 +131,7 @@ const PARALLEL_PROVIDERS: string[] = [ "free-trial", "replicate", "together", + "novita", "sambanova", "nebius", "vertexai", diff --git a/core/llm/llms/Novita.ts b/core/llm/llms/Novita.ts new file mode 100644 index 0000000000..7e90bbae68 --- /dev/null +++ b/core/llm/llms/Novita.ts @@ -0,0 +1,53 @@ +import OpenAI from "./OpenAI.js"; + +import type { CompletionOptions, LLMOptions } from "../../index.js"; + +class Novita extends OpenAI { + static providerName = "novita"; + static defaultOptions: Partial = { + apiBase: "https://api.novita.ai/v3/", + }; + + private static MODEL_IDS: { [name: string]: string } = { + // todo: yexiu + "codellama-7b": "togethercomputer/CodeLlama-7b-Instruct", + "codellama-13b": "togethercomputer/CodeLlama-13b-Instruct", + "codellama-34b": "togethercomputer/CodeLlama-34b-Instruct", + "codellama-70b": "codellama/CodeLlama-70b-Instruct-hf", + "llama3-8b": "meta-llama/Llama-3-8b-chat-hf", + "llama3-70b": "meta-llama/Llama-3-70b-chat-hf", + "llama3.1-8b": "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo", + "llama3.1-70b": "meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo", + "llama3.1-405b": "meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo", + "llama3.2-3b": "meta-llama/Llama-3.2-3B-Instruct-Turbo", + "llama3.2-11b": "meta-llama/Llama-3.2-11B-Vision-Instruct-Turbo", + "llama3.2-90b": "meta-llama/Llama-3.2-90B-Vision-Instruct-Turbo", + "llama2-7b": "togethercomputer/llama-2-7b-chat", + "llama2-13b": "togethercomputer/llama-2-13b-chat", + "llama2-70b": "togethercomputer/llama-2-70b-chat", + "mistral-7b": "mistralai/Mistral-7B-Instruct-v0.1", + "mistral-8x7b": "mistralai/Mixtral-8x7B-Instruct-v0.1", + "phind-codellama-34b": "Phind/Phind-CodeLlama-34B-v2", + "wizardcoder-34b": "WizardLM/WizardCoder-Python-34B-V1.0", + }; + + protected _convertModelName(model: string) { + return Novita.MODEL_IDS[model] || this.model; + } + + protected async *_streamComplete( + prompt: string, + signal: AbortSignal, + options: CompletionOptions, + ): AsyncGenerator { + for await (const chunk of this._legacystreamComplete( + prompt, + signal, + options, + )) { + yield chunk; + } + } +} + +export default Novita; diff --git a/core/llm/llms/index.ts b/core/llm/llms/index.ts index 7e1e2fdc51..20bc8b710f 100644 --- a/core/llm/llms/index.ts +++ b/core/llm/llms/index.ts @@ -48,6 +48,7 @@ import ContinueProxy from "./stubs/ContinueProxy"; import TestLLM from "./Test"; import TextGenWebUI from "./TextGenWebUI"; import Together from "./Together"; +import Novita from "./Novita"; import VertexAI from "./VertexAI"; import Vllm from "./Vllm"; import WatsonX from "./WatsonX"; @@ -65,6 +66,7 @@ export const LLMClasses = [ Replicate, TextGenWebUI, Together, + Novita, HuggingFaceTGI, HuggingFaceInferenceAPI, Kindo, diff --git a/docs/docs/chat/model-setup.mdx b/docs/docs/chat/model-setup.mdx index a5668786bb..0838b47201 100644 --- a/docs/docs/chat/model-setup.mdx +++ b/docs/docs/chat/model-setup.mdx @@ -33,7 +33,7 @@ Our current top recommendation is Claude Sonnet 3.5 from [Anthropic](../customiz ### Llama 3.1 405B from Meta -If you prefer to use an open-weight model, then Llama 3.1 405B from Meta is your best option right now. You will need to decide if you use it through a SaaS model provider (e.g. [Together](../customize/model-providers/more/together.md) or [Groq](../customize/model-providers/more/groq.md)) or self-host it (e.g. using [vLLM](../customize/model-providers//more/vllm.md) or [Ollama](../customize/model-providers/top-level/ollama.md)). +If you prefer to use an open-weight model, then Llama 3.1 405B from Meta is your best option right now. You will need to decide if you use it through a SaaS model provider (e.g. [Together](../customize/model-providers/more/together.md) or [Novita](../customize/model-providers/more/novita.md) or [Groq](../customize/model-providers/more/groq.md)) or self-host it (e.g. using [vLLM](../customize/model-providers//more/vllm.md) or [Ollama](../customize/model-providers/top-level/ollama.md)). @@ -48,6 +48,18 @@ If you prefer to use an open-weight model, then Llama 3.1 405B from Meta is your ] ``` + + ```json title="config.json" + "models": [ + { + "title": "Llama 3.1 405B", + "provider": "novita", + "model": "llama3.1-405b", + "apiKey": "[NOVITA_API_KEY]" + } + ] + ``` + ```json title="config.json" "models": [ diff --git a/docs/docs/customize/model-providers/more/novita.md b/docs/docs/customize/model-providers/more/novita.md new file mode 100644 index 0000000000..d3aa359a49 --- /dev/null +++ b/docs/docs/customize/model-providers/more/novita.md @@ -0,0 +1,18 @@ +# Novita + +The Novita API is a cloud platform for running large AI models. You can sign up [here](https://novita.ai/user/login?&redirect=/&utm_source=github_continuedev), copy your API key on the initial welcome screen, and then hit the play button on any model from the [Novita Models list](https://novita.ai/llm-api?utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=link). Change `~/.continue/config.json` to look like this: + +```json title="config.json" +{ + "models": [ + { + "title": "Novita Qwen2.5 Coder", + "provider": "novita", + "model": "Qwen/Qwen2.5-Coder-32B-Instruct", + "apiKey": "YOUR_API_KEY" + } + ] +} +``` + +[View the source](https://github.com/continuedev/continue/blob/main/core/llm/llms/Novita.ts) diff --git a/docs/docs/customize/tutorials/llama3.1.md b/docs/docs/customize/tutorials/llama3.1.md index 2cec71cda9..38c0f8b1b2 100644 --- a/docs/docs/customize/tutorials/llama3.1.md +++ b/docs/docs/customize/tutorials/llama3.1.md @@ -1,7 +1,7 @@ --- title: Using Llama 3.1 with Continue description: How to use Llama 3.1 with Continue -keywords: [llama, meta, togetherai, ollama, replicate] +keywords: [llama, meta, togetherai, novita, ollama, replicate] --- Continue makes it easy to code with the latest open-source models, including the entire Llama 3.1 family of models. Llama 3.2 models are also supported but not recommended for chat, because they are specifically designed to be small or multi-modal. @@ -71,6 +71,28 @@ Together AI provides fast and reliable inference of open-source models. You'll b } ``` + +## Novita AI + +Novita AI provides fast and reliable inference of open-source models. You'll be able to run the 405b model with good speed. + +1. Create an account [here](https://novita.ai/user/login?&redirect=/&utm_source=github_continuedev) +2. Copy your API key that appears on the welcome screen +3. Update your Continue config file like this: + +```json title="config.json" +{ + "models": [ + { + "title": "Llama 3.1 405b", + "provider": "novita", + "model": "llama3.1-405b", + "apiKey": "" + } + ] +} +``` + ## Replicate Replicate makes it easy to host and run open-source AI with an API. diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index be2fa5f594..82c11d8dec 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -388,7 +388,11 @@ const config = { }, { to: "/customize/model-providers/more/together", - from: "/reference/Model Providers/togetherllm", + from: "/reference/Model Providers/together", + }, + { + to: "/customize/model-providers/more/novita", + from: "/reference/Model Providers/novita", }, { to: "/customize/model-providers/more/vllm", diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/chat/model-setup.mdx b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/chat/model-setup.mdx index b95d976f1a..1157def5ec 100644 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/chat/model-setup.mdx +++ b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/chat/model-setup.mdx @@ -33,7 +33,7 @@ import TabItem from "@theme/TabItem"; ### 来自 Meta 的 Llama 3.1 405B -如果你倾向于使用开放权重模型,那么来自 Meta 的 Llama 3.1 405B 是你当前的最好选择。你需要决定,通过 SaaS 模型提供者使用它(比如 [Together](../customize/model-providers/more/together.md) 或 [Groq](../customize/model-providers/more/groq.md))或者自托管使用它(比如使用 [vLLM](../customize/model-providers//more/vllm.md) 或 [Ollama](../customize/model-providers/top-level/ollama.md)) 。 +如果你倾向于使用开放权重模型,那么来自 Meta 的 Llama 3.1 405B 是你当前的最好选择。你需要决定,通过 SaaS 模型提供者使用它(比如 [Together](../customize/model-providers/more/together.md) 、[Novita](../customize/model-providers/more/novita.md)或 [Groq](../customize/model-providers/more/groq.md))或者自托管使用它(比如使用 [vLLM](../customize/model-providers//more/vllm.md) 或 [Ollama](../customize/model-providers/top-level/ollama.md)) 。 @@ -48,6 +48,18 @@ import TabItem from "@theme/TabItem"; ] ``` + + ```json title="config.json" + "models": [ + { + "title": "Llama 3.1 405B", + "provider": "novita", + "model": "llama3.1-405b", + "apiKey": "[NOVITA_API_KEY]" + } + ] + ``` + ```json title="config.json" "models": [ diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/more/novita.md b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/more/novita.md new file mode 100644 index 0000000000..d3e335dca4 --- /dev/null +++ b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/more/novita.md @@ -0,0 +1,18 @@ +# Novita + +Novita API 是一个运行大 AI 模型的云平台。你可以在 [这里](https://novita.ai/user/login?&redirect=/&utm_source=github_continuedev) 注册,在最初欢迎屏幕复制你的 API key ,然后在 [Novita 模型列表](https://novita.ai/llm-api?utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=link) 的任何模型上点击 play 按钮。修改 `~/.continue/config.json` 像这样: + +```json title="config.json" +{ + "models": [ + { + "title": "Novita CodeLlama", + "provider": "Novita", + "model": "codellama-13b", + "apiKey": "YOUR_API_KEY" + } + ] +} +``` + +[查看代码](https://github.com/continuedev/continue/blob/main/core/llm/llms/Novita.ts) diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/tutorials/llama3.1.md b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/tutorials/llama3.1.md index 2453fbd948..1ca491b8c8 100644 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/tutorials/llama3.1.md +++ b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/tutorials/llama3.1.md @@ -1,7 +1,7 @@ --- title: Continue 使用 Llama 3.1 description: Continue 如何使用 Llama 3.1 -keywords: [llama, meta, togetherai, ollama, replicate] +keywords: [llama, meta, togetherai, novita, ollama, replicate] --- Continue 让使用最新的开元模型编码变得简单,包括整个 Llama 3.1 家族模型。 @@ -71,6 +71,27 @@ Together AI 提供开源模型的快速和可信任的推理。你可以以良 } ``` +## Novita AI + +Novita AI 提供开源模型的快速和可信任的推理。你可以以良好的速度运行 405b 模型。 + +1. 创建账号 [在这里](https://novita.ai/llm-api?utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=link) +2. 复制出现在Key Management你的 API key +3. 更新你的 Continue 配置文件像这样: + +```json title="config.json" +{ + "models": [ + { + "title": "Llama 3.1 405b", + "provider": "novita", + "model": "llama3.1-405b", + "apiKey": "" + } + ] +} +``` + ## Replicate Replicate 让使用 API 托管和运行开源 AI 变得简单。 diff --git a/extensions/vscode/config_schema.json b/extensions/vscode/config_schema.json index f2c98642f8..4886ba3264 100644 --- a/extensions/vscode/config_schema.json +++ b/extensions/vscode/config_schema.json @@ -180,6 +180,7 @@ "bedrockimport", "sagemaker", "together", + "novita", "ollama", "huggingface-tgi", "huggingface-inference-api", @@ -222,6 +223,7 @@ "### Bedrock Imported Models\nTo get started with Bedrock you need to sign up on AWS [here](https://aws.amazon.com/bedrock)", "### Sagemaker\nSagemaker is AWS' machine learning platform.", "### Together\nTogether is a hosted service that provides extremely fast streaming of open-source language models. To get started with Together:\n1. Obtain an API key from [here](https://together.ai)\n2. Paste below\n3. Select a model preset\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/togetherllm)", + "### Novita\nNovita is a hosted service that provides extremely fast streaming of open-source language models. To get started with Novita:\n1. Obtain an API key from [here](https://novita.ai)\n2. Paste below\n3. Select a model preset\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/novitallm)", "### Ollama\nTo get started with Ollama, follow these steps:\n1. Download from [ollama.ai](https://ollama.ai/) and open the application\n2. Open a terminal and run `ollama run `. Example model names are `codellama:7b-instruct` or `llama2:7b-text`. You can find the full list [here](https://ollama.ai/library).\n3. Make sure that the model name used in step 2 is the same as the one in config.json (e.g. `model=\"codellama:7b-instruct\"`)\n4. Once the model has finished downloading, you can start asking questions through Continue.\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/ollama)", "### Huggingface TGI\n\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/huggingfacetgi)", "### Huggingface Inference API\n\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/huggingfaceinferenceapi)", @@ -262,7 +264,7 @@ }, "apiKey": { "title": "Api Key", - "description": "OpenAI, Anthropic, Cohere, Together, or other API key", + "description": "OpenAI, Anthropic, Cohere, Together, Novita, or other API key", "type": "string" }, "apiBase": { @@ -475,6 +477,7 @@ "huggingface-inference-api", "replicate", "together", + "novita", "cloudflare", "sambanova", "nebius", @@ -980,6 +983,47 @@ } } }, + { + "if": { + "properties": { + "provider": { + "enum": ["novita"] + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "model": { + "anyOf": [ + { + "enum": [ + "mistral-7b", + "mistral-8x7b", + "llama2-7b", + "llama2-13b", + "llama3-8b", + "llama3-70b", + "llama3.1-8b", + "llama3.1-70b", + "llama3.1-405b", + "codellama-7b", + "codellama-13b", + "codellama-34b", + "codellama-70b", + "phind-codellama-34b" + ] + }, + { + "type": "string" + } + ], + "markdownDescription": "Select a pre-defined option, or find an exact model string from Novita AI [here](https://novita.ai/llm-api?utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=link).", + "x-intellij-html-description": "Select a pre-defined option, or find an exact model string from Novita AI here." + } + } + } + }, { "if": { "properties": { diff --git a/gui/src/pages/AddNewModel/configs/models.ts b/gui/src/pages/AddNewModel/configs/models.ts index f3e3203051..ed28e7a8df 100644 --- a/gui/src/pages/AddNewModel/configs/models.ts +++ b/gui/src/pages/AddNewModel/configs/models.ts @@ -65,6 +65,7 @@ export const models: { [key: string]: ModelPackage } = { "ollama", "lmstudio", "together", + "novita", "llama.cpp", "replicate", "sambanova", @@ -253,6 +254,7 @@ export const models: { [key: string]: ModelPackage } = { "ollama", "lmstudio", "together", + "novita", "llama.cpp", "replicate", "nebius", @@ -298,6 +300,7 @@ export const models: { [key: string]: ModelPackage } = { "ollama", "lmstudio", "together", + "novita", "llama.cpp", "replicate", ], @@ -445,7 +448,7 @@ export const models: { [key: string]: ModelPackage } = { contextLength: 8192, }, icon: "meta.png", - providerOptions: ["ollama", "groq", "llama.cpp", "sambanova", "together"], + providerOptions: ["ollama", "groq", "llama.cpp", "sambanova", "together", "novita"], isOpenSource: false, }, llama3211bChat: { @@ -458,7 +461,7 @@ export const models: { [key: string]: ModelPackage } = { contextLength: 8192, }, icon: "meta.png", - providerOptions: ["ollama", "groq", "llama.cpp", "together"], + providerOptions: ["ollama", "groq", "llama.cpp", "together", "novita"], isOpenSource: false, }, llama3290bChat: { @@ -504,6 +507,7 @@ export const models: { [key: string]: ModelPackage } = { "ollama", "lmstudio", "together", + "novita", "llama.cpp", "replicate", "nebius", diff --git a/gui/src/pages/AddNewModel/configs/providers.ts b/gui/src/pages/AddNewModel/configs/providers.ts index b3b80e6e13..f005dd6fa7 100644 --- a/gui/src/pages/AddNewModel/configs/providers.ts +++ b/gui/src/pages/AddNewModel/configs/providers.ts @@ -404,6 +404,38 @@ Select the \`GPT-4o\` model below to complete your provider configuration, but n }), apiKeyUrl: "https://api.together.xyz/settings/api-keys", }, + novita: { + title: "NovitaAI", + provider: "novita", + refPage: "novita", + description: + "Use the NovitaAI API for extremely fast streaming of open-source models", + icon: "novita.png", + longDescription: `Novita is a hosted service that provides extremely fast streaming of open-source language models. To get started with Novita:\n1. Obtain an API key from [here](https://novita.ai)\n2. Paste below\n3. Select a model preset`, + tags: [ModelProviderTags.RequiresApiKey, ModelProviderTags.OpenSource], + params: { + apiKey: "", + }, + collectInputFor: [ + { + inputType: "text", + key: "apiKey", + label: "API Key", + placeholder: "Enter your NovitaAI API key", + required: true, + }, + ...completionParamsInputsConfigs, + ], + packages: [ + models.llama31Chat, + models.codeLlamaInstruct, + models.mistralOs, + ].map((p) => { + p.params.contextLength = 4096; + return p; + }), + apiKeyUrl: "https://novita.ai/settings/key-management", + }, gemini: { title: "Google Gemini API", provider: "gemini", @@ -640,8 +672,8 @@ To get started, [register](https://dataplatform.cloud.ibm.com/registration/stepo provider: "free-trial", refPage: "freetrial", description: - "New users can try out Continue for free using a proxy server that securely makes calls to OpenAI, Anthropic, or Together using our API key", - longDescription: `New users can try out Continue for free using a proxy server that securely makes calls to OpenAI, Anthropic, or Together using our API key. If you are ready to set up a model for long-term use or have used all ${FREE_TRIAL_LIMIT_REQUESTS} free uses, you can enter your API key or use a local model.`, + "New users can try out Continue for free using a proxy server that securely makes calls to OpenAI, Anthropic, Together, or Novita using our API key", + longDescription: `New users can try out Continue for free using a proxy server that securely makes calls to OpenAI, Anthropic, Together or Novita using our API key. If you are ready to set up a model for long-term use or have used all ${FREE_TRIAL_LIMIT_REQUESTS} free uses, you can enter your API key or use a local model.`, icon: "openai.png", tags: [ModelProviderTags.Free], packages: [ diff --git a/packages/openai-adapters/README.md b/packages/openai-adapters/README.md index cebaa129f2..3d09e4afb9 100644 --- a/packages/openai-adapters/README.md +++ b/packages/openai-adapters/README.md @@ -59,6 +59,7 @@ They are concerned with: - [ ] Silicon Flow - [x] TextGen Web UI - [x] Together +- [x] Novita - [x] Vllm - [ ] Vertex AI - [x] Voyage AI diff --git a/packages/openai-adapters/src/index.ts b/packages/openai-adapters/src/index.ts index c3db18bcf2..2e7b362fc5 100644 --- a/packages/openai-adapters/src/index.ts +++ b/packages/openai-adapters/src/index.ts @@ -73,6 +73,8 @@ export function constructLlmApi(config: LLMConfig): BaseLlmApi | undefined { return openAICompatible("https://api.fireworks.ai/inference/v1/", config); case "together": return openAICompatible("https://api.together.xyz/v1/", config); + case "novita": + return openAICompatible("https://api.novita.ai/v3", config); case "nebius": return openAICompatible("https://api.studio.nebius.ai/v1/", config); case "function-network": diff --git a/packages/openai-adapters/src/types.ts b/packages/openai-adapters/src/types.ts index fbb21e2e04..29d0310f25 100644 --- a/packages/openai-adapters/src/types.ts +++ b/packages/openai-adapters/src/types.ts @@ -39,6 +39,7 @@ export const OpenAIConfigSchema = BasePlusConfig.extend({ z.literal("nvidia"), z.literal("fireworks"), z.literal("together"), + z.literal("novita"), z.literal("sambanova"), z.literal("nebius"), z.literal("function-network"), diff --git a/packages/openai-adapters/test/main.test.ts b/packages/openai-adapters/test/main.test.ts index 4a9117cabe..01e3e93002 100644 --- a/packages/openai-adapters/test/main.test.ts +++ b/packages/openai-adapters/test/main.test.ts @@ -267,6 +267,12 @@ const COMPLETION_TESTS: ({ chatOnly?: boolean } & LlmApiConfig)[] = [ apiKey: process.env.TOGETHER_API_KEY!, chatOnly: true, }, + { + provider: "novita", + model: "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo", + apiKey: process.env.NOVITA_API_KEY!, + chatOnly: true, + }, { provider: "sambanova", model: "Meta-Llama-3.1-8B-Instruct", From ad0fdb988b76bebadcbb26a3069b7f821207680f Mon Sep 17 00:00:00 2001 From: vercel Date: Tue, 24 Dec 2024 14:19:48 +0800 Subject: [PATCH 2/6] feat: fix version and address --- binary/package-lock.json | 1 + core/llm/llms/Novita.ts | 27 +++----------- .../customize/model-providers/more/novita.md | 4 +- extensions/vscode/package-lock.json | 4 +- gui/public/logos/novita.png | Bin 0 -> 6726 bytes gui/src/pages/AddNewModel/configs/models.ts | 35 +++++++++++++++--- .../pages/AddNewModel/configs/providers.ts | 4 +- packages/openai-adapters/src/index.ts | 2 +- 8 files changed, 42 insertions(+), 35 deletions(-) create mode 100644 gui/public/logos/novita.png diff --git a/binary/package-lock.json b/binary/package-lock.json index 6f7c394d1d..c026c940c9 100644 --- a/binary/package-lock.json +++ b/binary/package-lock.json @@ -48,6 +48,7 @@ "@aws-sdk/client-sagemaker-runtime": "^3.621.0", "@aws-sdk/credential-providers": "^3.620.1", "@continuedev/config-types": "^1.0.13", + "@continuedev/config-yaml": "^1.0.0", "@continuedev/fetch": "^1.0.4", "@continuedev/llm-info": "^1.0.2", "@continuedev/openai-adapters": "^1.0.10", diff --git a/core/llm/llms/Novita.ts b/core/llm/llms/Novita.ts index 7e90bbae68..9121bd6c25 100644 --- a/core/llm/llms/Novita.ts +++ b/core/llm/llms/Novita.ts @@ -5,30 +5,15 @@ import type { CompletionOptions, LLMOptions } from "../../index.js"; class Novita extends OpenAI { static providerName = "novita"; static defaultOptions: Partial = { - apiBase: "https://api.novita.ai/v3/", + apiBase: "https://api.novita.ai/v3/openai/", }; private static MODEL_IDS: { [name: string]: string } = { - // todo: yexiu - "codellama-7b": "togethercomputer/CodeLlama-7b-Instruct", - "codellama-13b": "togethercomputer/CodeLlama-13b-Instruct", - "codellama-34b": "togethercomputer/CodeLlama-34b-Instruct", - "codellama-70b": "codellama/CodeLlama-70b-Instruct-hf", - "llama3-8b": "meta-llama/Llama-3-8b-chat-hf", - "llama3-70b": "meta-llama/Llama-3-70b-chat-hf", - "llama3.1-8b": "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo", - "llama3.1-70b": "meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo", - "llama3.1-405b": "meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo", - "llama3.2-3b": "meta-llama/Llama-3.2-3B-Instruct-Turbo", - "llama3.2-11b": "meta-llama/Llama-3.2-11B-Vision-Instruct-Turbo", - "llama3.2-90b": "meta-llama/Llama-3.2-90B-Vision-Instruct-Turbo", - "llama2-7b": "togethercomputer/llama-2-7b-chat", - "llama2-13b": "togethercomputer/llama-2-13b-chat", - "llama2-70b": "togethercomputer/llama-2-70b-chat", - "mistral-7b": "mistralai/Mistral-7B-Instruct-v0.1", - "mistral-8x7b": "mistralai/Mixtral-8x7B-Instruct-v0.1", - "phind-codellama-34b": "Phind/Phind-CodeLlama-34B-v2", - "wizardcoder-34b": "WizardLM/WizardCoder-Python-34B-V1.0", + "llama3.1-8b": "meta-llama/llama-3.1-8b-instruct", + "llama3.1-70b": "meta-llama/llama-3.1-70b-instruct", + "llama3.1-405b": "meta-llama/llama-3.1-405b-instruct", + "llama3.2-3b": "meta-llama/llama-3.2-3b-instruct", + "llama3.2-11b": "meta-llama/llama-3.2-11b-vision-instruct", }; protected _convertModelName(model: string) { diff --git a/docs/docs/customize/model-providers/more/novita.md b/docs/docs/customize/model-providers/more/novita.md index d3aa359a49..92fe572a14 100644 --- a/docs/docs/customize/model-providers/more/novita.md +++ b/docs/docs/customize/model-providers/more/novita.md @@ -6,9 +6,9 @@ The Novita API is a cloud platform for running large AI models. You can sign up { "models": [ { - "title": "Novita Qwen2.5 Coder", + "title": "Llama 3.1 8B", "provider": "novita", - "model": "Qwen/Qwen2.5-Coder-32B-Instruct", + "model": "meta-llama/llama-3.1-8b-instruct", "apiKey": "YOUR_API_KEY" } ] diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index 3e213c9998..ca4edfc38b 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "0.9.244", + "version": "0.9.246", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "continue", - "version": "0.9.244", + "version": "0.9.246", "license": "Apache-2.0", "dependencies": { "@continuedev/fetch": "^1.0.3", diff --git a/gui/public/logos/novita.png b/gui/public/logos/novita.png new file mode 100644 index 0000000000000000000000000000000000000000..b744cd35cc7825bba5c201be63d76e3993a75ec9 GIT binary patch literal 6726 zcmV-M8oA|(P)b`>$2vY1tM6d%M!!jF(Kj5*%-r3p+W*mt{kce$Xh#*L8*hNBQ!U|=9$6mk= zoL^w)AAs1f%DfRmGO)<(h#gNC_uf-a)l;Y2B!cPJhIFC$81%v7ew6b= zl{K~{Z70LxIhk4IPWN?`cSL*T?KFe!l9pco_P>1JULlW{?ayERia&P&{NwucQ40y^ zi-NVfLWFDM&&~yXKCWAywf06C8;>K;v$F$%`amobP z&N9ZiKDzb!-}IY1PyYI|ervs6kH#p`(Hfadjq+|~IUr?DA4GbWB>7#24e6 z6-XZ`1hJlaR`l%3xRqSS;{yJ&;G%68@QRhUc4n_npGyFy zrq+O!7;2@>9a8Ht!AP2;GEU1C6BAC7Xe-kUW-5f3AvKR}7#TB`aNC|#T+3MwebnJyDO2&*uN z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PBr}Z|x2*e-l}yCM;OSY`8O+~*RV2}8W%kQwWcGtd*YJSS^W!J3 zwio{HGk$Zm>syHLM@M$55m(La(;_RV7BjN?sZ(^YyS|Z{jjC8K-~-f zWp6zHANK6Zsi)T0i?$v2MMfke>6(b2@aogjtvX2nrc?Oc0bk{I&Hpi-mBdxsFW1+d zmGMt~V0d$Q^wO($n%)K$= zI^o0wPByL|4i(rg5xXBG0`s4D&Hk{oYx}zcW_*Jg8``eB?bhGVpFP$uQS=IH9`5v! z>ca*zzq2y_g?DXZ`m-y~-dwXU<%B*V#1umI`$aI{KH`D=lMCnKw6>aok*a zc*7#Z%Y8f>$A-BJv{(Lljz<2!>GxJ`zqLj)D+f1?|I!xCKz4HCQ_1N#xs cozYwRAM>ak5A>yRrT_o{07*qoM6N<$g587>V*mgE literal 0 HcmV?d00001 diff --git a/gui/src/pages/AddNewModel/configs/models.ts b/gui/src/pages/AddNewModel/configs/models.ts index ed28e7a8df..d43ed2ec1f 100644 --- a/gui/src/pages/AddNewModel/configs/models.ts +++ b/gui/src/pages/AddNewModel/configs/models.ts @@ -31,6 +31,33 @@ export interface ModelPackage { } export const models: { [key: string]: ModelPackage } = { + llama318BChat: { + title: "Llama 3.1 8B", + description: "A model from Meta, fine-tuned for chat", + refUrl: "", + params: { + title: "Llama3.1-8b", + model: "meta-llama/llama-3.1-8b-instruct", + contextLength: 8192, + }, + icon: "meta.png", + dimensions: [ + { + name: "Parameter Count", + description: "The number of parameters in the model", + options: { + "8b": { + model: "meta-llama/llama-3.1-8b-instruct", + title: "Llama3.1-8b", + } + }, + }, + ], + providerOptions: [ + "novita" + ], + isOpenSource: true, + }, llama31Chat: { title: "Llama3.1 Chat", description: "A model from Meta, fine-tuned for chat", @@ -65,7 +92,6 @@ export const models: { [key: string]: ModelPackage } = { "ollama", "lmstudio", "together", - "novita", "llama.cpp", "replicate", "sambanova", @@ -254,7 +280,6 @@ export const models: { [key: string]: ModelPackage } = { "ollama", "lmstudio", "together", - "novita", "llama.cpp", "replicate", "nebius", @@ -300,7 +325,6 @@ export const models: { [key: string]: ModelPackage } = { "ollama", "lmstudio", "together", - "novita", "llama.cpp", "replicate", ], @@ -448,7 +472,7 @@ export const models: { [key: string]: ModelPackage } = { contextLength: 8192, }, icon: "meta.png", - providerOptions: ["ollama", "groq", "llama.cpp", "sambanova", "together", "novita"], + providerOptions: ["ollama", "groq", "llama.cpp", "sambanova", "together"], isOpenSource: false, }, llama3211bChat: { @@ -461,7 +485,7 @@ export const models: { [key: string]: ModelPackage } = { contextLength: 8192, }, icon: "meta.png", - providerOptions: ["ollama", "groq", "llama.cpp", "together", "novita"], + providerOptions: ["ollama", "groq", "llama.cpp", "together"], isOpenSource: false, }, llama3290bChat: { @@ -507,7 +531,6 @@ export const models: { [key: string]: ModelPackage } = { "ollama", "lmstudio", "together", - "novita", "llama.cpp", "replicate", "nebius", diff --git a/gui/src/pages/AddNewModel/configs/providers.ts b/gui/src/pages/AddNewModel/configs/providers.ts index f005dd6fa7..647828c7fa 100644 --- a/gui/src/pages/AddNewModel/configs/providers.ts +++ b/gui/src/pages/AddNewModel/configs/providers.ts @@ -427,9 +427,7 @@ Select the \`GPT-4o\` model below to complete your provider configuration, but n ...completionParamsInputsConfigs, ], packages: [ - models.llama31Chat, - models.codeLlamaInstruct, - models.mistralOs, + models.llama318BChat, ].map((p) => { p.params.contextLength = 4096; return p; diff --git a/packages/openai-adapters/src/index.ts b/packages/openai-adapters/src/index.ts index 2e7b362fc5..4a42bbfeef 100644 --- a/packages/openai-adapters/src/index.ts +++ b/packages/openai-adapters/src/index.ts @@ -74,7 +74,7 @@ export function constructLlmApi(config: LLMConfig): BaseLlmApi | undefined { case "together": return openAICompatible("https://api.together.xyz/v1/", config); case "novita": - return openAICompatible("https://api.novita.ai/v3", config); + return openAICompatible("https://api.novita.ai/v3/openai", config); case "nebius": return openAICompatible("https://api.studio.nebius.ai/v1/", config); case "function-network": From 8d3ecafa3dbd9a3373ec7784eda1feac6b77b684 Mon Sep 17 00:00:00 2001 From: vercel Date: Tue, 24 Dec 2024 15:05:22 +0800 Subject: [PATCH 3/6] feat: change model desc --- docs/docs/chat/model-setup.mdx | 2 +- docs/docs/customize/tutorials/llama3.1.md | 2 +- .../current/chat/model-setup.mdx | 2 +- .../customize/model-providers/more/novita.md | 6 +++--- .../current/customize/tutorials/llama3.1.md | 2 +- extensions/vscode/config_schema.json | 14 +++++--------- packages/openai-adapters/test/main.test.ts | 2 +- 7 files changed, 13 insertions(+), 17 deletions(-) diff --git a/docs/docs/chat/model-setup.mdx b/docs/docs/chat/model-setup.mdx index 0838b47201..f0a1b95085 100644 --- a/docs/docs/chat/model-setup.mdx +++ b/docs/docs/chat/model-setup.mdx @@ -54,7 +54,7 @@ If you prefer to use an open-weight model, then Llama 3.1 405B from Meta is your { "title": "Llama 3.1 405B", "provider": "novita", - "model": "llama3.1-405b", + "model": "meta-llama/llama-3.1-405b-instruct", "apiKey": "[NOVITA_API_KEY]" } ] diff --git a/docs/docs/customize/tutorials/llama3.1.md b/docs/docs/customize/tutorials/llama3.1.md index 38c0f8b1b2..a5505f6d5e 100644 --- a/docs/docs/customize/tutorials/llama3.1.md +++ b/docs/docs/customize/tutorials/llama3.1.md @@ -86,7 +86,7 @@ Novita AI provides fast and reliable inference of open-source models. You'll be { "title": "Llama 3.1 405b", "provider": "novita", - "model": "llama3.1-405b", + "model": "meta-llama/llama-3.1-405b-instruct", "apiKey": "" } ] diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/chat/model-setup.mdx b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/chat/model-setup.mdx index 1157def5ec..35db62cc3b 100644 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/chat/model-setup.mdx +++ b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/chat/model-setup.mdx @@ -54,7 +54,7 @@ import TabItem from "@theme/TabItem"; { "title": "Llama 3.1 405B", "provider": "novita", - "model": "llama3.1-405b", + "model": "meta-llama/llama-3.1-405b-instruct", "apiKey": "[NOVITA_API_KEY]" } ] diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/more/novita.md b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/more/novita.md index d3e335dca4..4c413c2e8a 100644 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/more/novita.md +++ b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/more/novita.md @@ -1,14 +1,14 @@ # Novita -Novita API 是一个运行大 AI 模型的云平台。你可以在 [这里](https://novita.ai/user/login?&redirect=/&utm_source=github_continuedev) 注册,在最初欢迎屏幕复制你的 API key ,然后在 [Novita 模型列表](https://novita.ai/llm-api?utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=link) 的任何模型上点击 play 按钮。修改 `~/.continue/config.json` 像这样: +Novita API 是一个运行大 AI 模型的云平台。你可以在 [这里](https://novita.ai/user/login?&redirect=/&utm_source=github_continuedev) 注册,在最初欢迎屏幕复制你的 API key ,然后在 [Novita 模型列表](https://novita.ai/llm-api?utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=link) 的任何模型上点击 Try it now 按钮。修改 `~/.continue/config.json` 像这样: ```json title="config.json" { "models": [ { - "title": "Novita CodeLlama", + "title": "Llama 3.1 8b", "provider": "Novita", - "model": "codellama-13b", + "model": "meta-llama/llama-3.1-8b-instruct", "apiKey": "YOUR_API_KEY" } ] diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/tutorials/llama3.1.md b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/tutorials/llama3.1.md index 1ca491b8c8..a36b5070d8 100644 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/tutorials/llama3.1.md +++ b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/tutorials/llama3.1.md @@ -85,7 +85,7 @@ Novita AI 提供开源模型的快速和可信任的推理。你可以以良好 { "title": "Llama 3.1 405b", "provider": "novita", - "model": "llama3.1-405b", + "model": "meta-llama/llama-3.1-405b-instruct", "apiKey": "" } ] diff --git a/extensions/vscode/config_schema.json b/extensions/vscode/config_schema.json index 4886ba3264..7ecff0aa48 100644 --- a/extensions/vscode/config_schema.json +++ b/extensions/vscode/config_schema.json @@ -998,20 +998,16 @@ "anyOf": [ { "enum": [ - "mistral-7b", - "mistral-8x7b", - "llama2-7b", - "llama2-13b", "llama3-8b", "llama3-70b", "llama3.1-8b", "llama3.1-70b", "llama3.1-405b", - "codellama-7b", - "codellama-13b", - "codellama-34b", - "codellama-70b", - "phind-codellama-34b" + "llama3.2-3b", + "llama3.2-11b", + "llama-3.3-70b", + "mistral-nemo", + "mistral-7b" ] }, { diff --git a/packages/openai-adapters/test/main.test.ts b/packages/openai-adapters/test/main.test.ts index 01e3e93002..7e4a56d063 100644 --- a/packages/openai-adapters/test/main.test.ts +++ b/packages/openai-adapters/test/main.test.ts @@ -269,7 +269,7 @@ const COMPLETION_TESTS: ({ chatOnly?: boolean } & LlmApiConfig)[] = [ }, { provider: "novita", - model: "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo", + model: "meta-llama/llama-3.1-8b-instruct", apiKey: process.env.NOVITA_API_KEY!, chatOnly: true, }, From a25afeeda10c86072f80c025c20c21b167ddaaf0 Mon Sep 17 00:00:00 2001 From: vercel Date: Tue, 24 Dec 2024 18:57:16 +0800 Subject: [PATCH 4/6] feat: brand text fix --- CONTRIBUTING.md | 4 ++-- docs/docs/chat/model-setup.mdx | 2 +- docs/docs/customize/model-providers/more/novita.md | 2 +- docs/docs/customize/tutorials/llama3.1.md | 2 +- .../current/chat/model-setup.mdx | 2 +- .../current/customize/model-providers/more/novita.md | 2 +- .../current/customize/tutorials/llama3.1.md | 6 +++--- extensions/vscode/config_schema.json | 4 ++-- gui/src/pages/AddNewModel/configs/providers.ts | 10 +++++----- packages/openai-adapters/README.md | 2 +- 10 files changed, 18 insertions(+), 18 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 843f5ad171..458fc6038f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -188,7 +188,7 @@ After you've written your context provider, make sure to complete the following: ### Adding an LLM Provider -Continue has support for more than a dozen different LLM "providers", making it easy to use models running on OpenAI, Ollama, Together, Novita, LM Studio, Msty, and more. You can find all of the existing providers [here](https://github.com/continuedev/continue/tree/main/core/llm/llms), and if you see one missing, you can add it with the following steps: +Continue has support for more than a dozen different LLM "providers", making it easy to use models running on OpenAI, Ollama, Together, Novita AI, LM Studio, Msty, and more. You can find all of the existing providers [here](https://github.com/continuedev/continue/tree/main/core/llm/llms), and if you see one missing, you can add it with the following steps: 1. Create a new file in the `core/llm/llms` directory. The name of the file should be the name of the provider, and it should export a class that extends `BaseLLM`. This class should contain the following minimal implementation. We recommend viewing pre-existing providers for more details. The [LlamaCpp Provider](./core/llm/llms/LlamaCpp.ts) is a good simple example. @@ -209,7 +209,7 @@ While any model that works with a supported provider can be used with Continue, 1. Add a `ModelPackage` entry for the model into [configs/models.ts](./gui/src/pages/AddNewModel/configs/models.ts), following the lead of the many examples near the top of the file 2. Add the model within its provider's array to [AddNewModel.tsx](./gui/src/pages/AddNewModel/AddNewModel.tsx) (add provider if needed) - [index.d.ts](./core/index.d.ts) - This file defines the TypeScript types used throughout Continue. You'll find a `ModelName` type. Be sure to add the name of your model to this. -- LLM Providers: Since many providers use their own custom strings to identify models, you'll have to add the translation from Continue's model name (the one you added to `index.d.ts`) and the model string for each of these providers: [Ollama](./core/llm/llms/Ollama.ts), [Together](./core/llm/llms/Together.ts), [Novita](./core/llm/llms/Novita.ts), and [Replicate](./core/llm/llms/Replicate.ts). You can find their full model lists here: [Ollama](https://ollama.ai/library), [Together](https://docs.together.ai/docs/inference-models), [Novita](https://novita.ai/llm-api?utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=link), [Replicate](https://replicate.com/collections/streaming-language-models). +- LLM Providers: Since many providers use their own custom strings to identify models, you'll have to add the translation from Continue's model name (the one you added to `index.d.ts`) and the model string for each of these providers: [Ollama](./core/llm/llms/Ollama.ts), [Together](./core/llm/llms/Together.ts), [Novita AI](./core/llm/llms/Novita.ts), and [Replicate](./core/llm/llms/Replicate.ts). You can find their full model lists here: [Ollama](https://ollama.ai/library), [Together](https://docs.together.ai/docs/inference-models), [Novita AI](https://novita.ai/llm-api?utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=link), [Replicate](https://replicate.com/collections/streaming-language-models). - [Prompt Templates](./core/llm/index.ts) - In this file you'll find the `autodetectTemplateType` function. Make sure that for the model name you just added, this function returns the correct template type. This is assuming that the chat template for that model is already built in Continue. If not, you will have to add the template type and corresponding edit and chat templates. ### Adding Pre-indexed Documentation diff --git a/docs/docs/chat/model-setup.mdx b/docs/docs/chat/model-setup.mdx index f0a1b95085..41f7709d64 100644 --- a/docs/docs/chat/model-setup.mdx +++ b/docs/docs/chat/model-setup.mdx @@ -33,7 +33,7 @@ Our current top recommendation is Claude Sonnet 3.5 from [Anthropic](../customiz ### Llama 3.1 405B from Meta -If you prefer to use an open-weight model, then Llama 3.1 405B from Meta is your best option right now. You will need to decide if you use it through a SaaS model provider (e.g. [Together](../customize/model-providers/more/together.md) or [Novita](../customize/model-providers/more/novita.md) or [Groq](../customize/model-providers/more/groq.md)) or self-host it (e.g. using [vLLM](../customize/model-providers//more/vllm.md) or [Ollama](../customize/model-providers/top-level/ollama.md)). +If you prefer to use an open-weight model, then Llama 3.1 405B from Meta is your best option right now. You will need to decide if you use it through a SaaS model provider (e.g. [Together](../customize/model-providers/more/together.md) or [Novita AI](../customize/model-providers/more/novita.md) or [Groq](../customize/model-providers/more/groq.md)) or self-host it (e.g. using [vLLM](../customize/model-providers//more/vllm.md) or [Ollama](../customize/model-providers/top-level/ollama.md)). diff --git a/docs/docs/customize/model-providers/more/novita.md b/docs/docs/customize/model-providers/more/novita.md index 92fe572a14..841d3e11e2 100644 --- a/docs/docs/customize/model-providers/more/novita.md +++ b/docs/docs/customize/model-providers/more/novita.md @@ -1,6 +1,6 @@ # Novita -The Novita API is a cloud platform for running large AI models. You can sign up [here](https://novita.ai/user/login?&redirect=/&utm_source=github_continuedev), copy your API key on the initial welcome screen, and then hit the play button on any model from the [Novita Models list](https://novita.ai/llm-api?utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=link). Change `~/.continue/config.json` to look like this: +[Novita AI](https://novita.ai) offers an affordable, reliable, and simple inference platform with scalable [LLM API](https://novita.ai/docs/model-api/reference/introduction.html), empowering developers to build AI applications. Try the [Novita AI Llama 3 API Demo](https://novita.ai/model-api/product/llm-api/playground/meta-llama-llama-3.1-70b-instruct) today!. You can sign up [here](https://novita.ai/user/login?&redirect=/&utm_source=github_continuedev), copy your API key on the [Key Management](https://novita.ai/settings/key-management), and then hit the play button on any model from the [Novita AI Models list](https://novita.ai/llm-api?utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=link). Change `~/.continue/config.json` to look like this: ```json title="config.json" { diff --git a/docs/docs/customize/tutorials/llama3.1.md b/docs/docs/customize/tutorials/llama3.1.md index a5505f6d5e..28decd81e5 100644 --- a/docs/docs/customize/tutorials/llama3.1.md +++ b/docs/docs/customize/tutorials/llama3.1.md @@ -74,7 +74,7 @@ Together AI provides fast and reliable inference of open-source models. You'll b ## Novita AI -Novita AI provides fast and reliable inference of open-source models. You'll be able to run the 405b model with good speed. +[Novita AI](https://novita.ai) offers an affordable, reliable, and simple inference platform with scalable [LLM API](https://novita.ai/docs/model-api/reference/introduction.html), empowering developers to build AI applications. Try the [Novita AI Llama 3 API Demo](https://novita.ai/model-api/product/llm-api/playground/meta-llama-llama-3.1-70b-instruct) today! 1. Create an account [here](https://novita.ai/user/login?&redirect=/&utm_source=github_continuedev) 2. Copy your API key that appears on the welcome screen diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/chat/model-setup.mdx b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/chat/model-setup.mdx index 35db62cc3b..4ef37a41e4 100644 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/chat/model-setup.mdx +++ b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/chat/model-setup.mdx @@ -33,7 +33,7 @@ import TabItem from "@theme/TabItem"; ### 来自 Meta 的 Llama 3.1 405B -如果你倾向于使用开放权重模型,那么来自 Meta 的 Llama 3.1 405B 是你当前的最好选择。你需要决定,通过 SaaS 模型提供者使用它(比如 [Together](../customize/model-providers/more/together.md) 、[Novita](../customize/model-providers/more/novita.md)或 [Groq](../customize/model-providers/more/groq.md))或者自托管使用它(比如使用 [vLLM](../customize/model-providers//more/vllm.md) 或 [Ollama](../customize/model-providers/top-level/ollama.md)) 。 +如果你倾向于使用开放权重模型,那么来自 Meta 的 Llama 3.1 405B 是你当前的最好选择。你需要决定,通过 SaaS 模型提供者使用它(比如 [Together](../customize/model-providers/more/together.md) 、[Novita AI](../customize/model-providers/more/novita.md)或 [Groq](../customize/model-providers/more/groq.md))或者自托管使用它(比如使用 [vLLM](../customize/model-providers//more/vllm.md) 或 [Ollama](../customize/model-providers/top-level/ollama.md)) 。 diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/more/novita.md b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/more/novita.md index 4c413c2e8a..97adaa0815 100644 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/more/novita.md +++ b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/more/novita.md @@ -1,6 +1,6 @@ # Novita -Novita API 是一个运行大 AI 模型的云平台。你可以在 [这里](https://novita.ai/user/login?&redirect=/&utm_source=github_continuedev) 注册,在最初欢迎屏幕复制你的 API key ,然后在 [Novita 模型列表](https://novita.ai/llm-api?utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=link) 的任何模型上点击 Try it now 按钮。修改 `~/.continue/config.json` 像这样: +[Novita AI](https://novita.ai) 提供了一个经济实惠、可靠且简单的推理平台。你可以在 [这里](https://novita.ai/user/login?&redirect=/&utm_source=github_continuedev) 注册,在 [Key 管理页面](https://novita.ai/settings/key-management)复制你的 API key ,然后在 [Novita 模型列表](https://novita.ai/llm-api?utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=link) 的任何模型上点击 Try it now 按钮。修改 `~/.continue/config.json` 像这样: ```json title="config.json" { diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/tutorials/llama3.1.md b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/tutorials/llama3.1.md index a36b5070d8..126be8f502 100644 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/tutorials/llama3.1.md +++ b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/tutorials/llama3.1.md @@ -73,11 +73,11 @@ Together AI 提供开源模型的快速和可信任的推理。你可以以良 ## Novita AI -Novita AI 提供开源模型的快速和可信任的推理。你可以以良好的速度运行 405b 模型。 +[Novita AI](https://novita.ai) 提供了一个经济实惠、可靠且简单的推理平台。你可以以良好的速度运行 405b 模型。 1. 创建账号 [在这里](https://novita.ai/llm-api?utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=link) -2. 复制出现在Key Management你的 API key -3. 更新你的 Continue 配置文件像这样: +2. 复制[Key Management](https://novita.ai/settings/key-management)中的你的 API key +3. 更新你的 Continue 配置文件,像这样: ```json title="config.json" { diff --git a/extensions/vscode/config_schema.json b/extensions/vscode/config_schema.json index 7ecff0aa48..76eedf998f 100644 --- a/extensions/vscode/config_schema.json +++ b/extensions/vscode/config_schema.json @@ -223,7 +223,7 @@ "### Bedrock Imported Models\nTo get started with Bedrock you need to sign up on AWS [here](https://aws.amazon.com/bedrock)", "### Sagemaker\nSagemaker is AWS' machine learning platform.", "### Together\nTogether is a hosted service that provides extremely fast streaming of open-source language models. To get started with Together:\n1. Obtain an API key from [here](https://together.ai)\n2. Paste below\n3. Select a model preset\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/togetherllm)", - "### Novita\nNovita is a hosted service that provides extremely fast streaming of open-source language models. To get started with Novita:\n1. Obtain an API key from [here](https://novita.ai)\n2. Paste below\n3. Select a model preset\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/novitallm)", + "### Novita AI\n[Novita AI](https://novita.ai) offers an affordable, reliable, and simple inference platform with scalable [LLM APIs](https://novita.ai/docs/model-api/reference/introduction.html), empowering developers to build AI applications. To get started with Novita AI:\n1. Obtain an API key from [here](https://novita.ai/settings/key-management)\n2. Paste below\n3. Select a model preset\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/novitallm)", "### Ollama\nTo get started with Ollama, follow these steps:\n1. Download from [ollama.ai](https://ollama.ai/) and open the application\n2. Open a terminal and run `ollama run `. Example model names are `codellama:7b-instruct` or `llama2:7b-text`. You can find the full list [here](https://ollama.ai/library).\n3. Make sure that the model name used in step 2 is the same as the one in config.json (e.g. `model=\"codellama:7b-instruct\"`)\n4. Once the model has finished downloading, you can start asking questions through Continue.\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/ollama)", "### Huggingface TGI\n\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/huggingfacetgi)", "### Huggingface Inference API\n\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/huggingfaceinferenceapi)", @@ -264,7 +264,7 @@ }, "apiKey": { "title": "Api Key", - "description": "OpenAI, Anthropic, Cohere, Together, Novita, or other API key", + "description": "OpenAI, Anthropic, Cohere, Together, Novita AI, or other API key", "type": "string" }, "apiBase": { diff --git a/gui/src/pages/AddNewModel/configs/providers.ts b/gui/src/pages/AddNewModel/configs/providers.ts index 647828c7fa..8ef4129eb1 100644 --- a/gui/src/pages/AddNewModel/configs/providers.ts +++ b/gui/src/pages/AddNewModel/configs/providers.ts @@ -409,9 +409,9 @@ Select the \`GPT-4o\` model below to complete your provider configuration, but n provider: "novita", refPage: "novita", description: - "Use the NovitaAI API for extremely fast streaming of open-source models", + "Use Novita AI API for extremely fast streaming of open-source models", icon: "novita.png", - longDescription: `Novita is a hosted service that provides extremely fast streaming of open-source language models. To get started with Novita:\n1. Obtain an API key from [here](https://novita.ai)\n2. Paste below\n3. Select a model preset`, + longDescription: `[Novita AI](https://novita.ai) offers an affordable, reliable, and simple inference platform with scalable [LLM APIs](https://novita.ai/docs/model-api/reference/introduction.html), empowering developers to build AI applications. To get started with Novita AI:\n1. Obtain an API key from [here](https://novita.ai)\n2. Paste below\n3. Select a model preset`, tags: [ModelProviderTags.RequiresApiKey, ModelProviderTags.OpenSource], params: { apiKey: "", @@ -421,7 +421,7 @@ Select the \`GPT-4o\` model below to complete your provider configuration, but n inputType: "text", key: "apiKey", label: "API Key", - placeholder: "Enter your NovitaAI API key", + placeholder: "Enter your Novita AI API key", required: true, }, ...completionParamsInputsConfigs, @@ -670,8 +670,8 @@ To get started, [register](https://dataplatform.cloud.ibm.com/registration/stepo provider: "free-trial", refPage: "freetrial", description: - "New users can try out Continue for free using a proxy server that securely makes calls to OpenAI, Anthropic, Together, or Novita using our API key", - longDescription: `New users can try out Continue for free using a proxy server that securely makes calls to OpenAI, Anthropic, Together or Novita using our API key. If you are ready to set up a model for long-term use or have used all ${FREE_TRIAL_LIMIT_REQUESTS} free uses, you can enter your API key or use a local model.`, + "New users can try out Continue for free using a proxy server that securely makes calls to OpenAI, Anthropic, Together, or Novita AI using our API key", + longDescription: `New users can try out Continue for free using a proxy server that securely makes calls to OpenAI, Anthropic, Together or Novita AI using our API key. If you are ready to set up a model for long-term use or have used all ${FREE_TRIAL_LIMIT_REQUESTS} free uses, you can enter your API key or use a local model.`, icon: "openai.png", tags: [ModelProviderTags.Free], packages: [ diff --git a/packages/openai-adapters/README.md b/packages/openai-adapters/README.md index 3d09e4afb9..b84b198e7f 100644 --- a/packages/openai-adapters/README.md +++ b/packages/openai-adapters/README.md @@ -59,7 +59,7 @@ They are concerned with: - [ ] Silicon Flow - [x] TextGen Web UI - [x] Together -- [x] Novita +- [x] Novita AI - [x] Vllm - [ ] Vertex AI - [x] Voyage AI From d59b3b5297924b2b6343a990c09551be4af9c670 Mon Sep 17 00:00:00 2001 From: vercel Date: Tue, 24 Dec 2024 20:00:43 +0800 Subject: [PATCH 5/6] feat: fix address --- CONTRIBUTING.md | 2 +- docs/docs/customize/model-providers/more/novita.md | 2 +- docs/docs/customize/tutorials/llama3.1.md | 4 ++-- .../current/customize/model-providers/more/novita.md | 2 +- .../current/customize/tutorials/llama3.1.md | 6 +++--- extensions/vscode/config_schema.json | 6 +++--- gui/src/pages/AddNewModel/configs/providers.ts | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 458fc6038f..eddf7b45bb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -209,7 +209,7 @@ While any model that works with a supported provider can be used with Continue, 1. Add a `ModelPackage` entry for the model into [configs/models.ts](./gui/src/pages/AddNewModel/configs/models.ts), following the lead of the many examples near the top of the file 2. Add the model within its provider's array to [AddNewModel.tsx](./gui/src/pages/AddNewModel/AddNewModel.tsx) (add provider if needed) - [index.d.ts](./core/index.d.ts) - This file defines the TypeScript types used throughout Continue. You'll find a `ModelName` type. Be sure to add the name of your model to this. -- LLM Providers: Since many providers use their own custom strings to identify models, you'll have to add the translation from Continue's model name (the one you added to `index.d.ts`) and the model string for each of these providers: [Ollama](./core/llm/llms/Ollama.ts), [Together](./core/llm/llms/Together.ts), [Novita AI](./core/llm/llms/Novita.ts), and [Replicate](./core/llm/llms/Replicate.ts). You can find their full model lists here: [Ollama](https://ollama.ai/library), [Together](https://docs.together.ai/docs/inference-models), [Novita AI](https://novita.ai/llm-api?utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=link), [Replicate](https://replicate.com/collections/streaming-language-models). +- LLM Providers: Since many providers use their own custom strings to identify models, you'll have to add the translation from Continue's model name (the one you added to `index.d.ts`) and the model string for each of these providers: [Ollama](./core/llm/llms/Ollama.ts), [Together](./core/llm/llms/Together.ts), [Novita AI](./core/llm/llms/Novita.ts), and [Replicate](./core/llm/llms/Replicate.ts). You can find their full model lists here: [Ollama](https://ollama.ai/library), [Together](https://docs.together.ai/docs/inference-models), [Novita AI](https://novita.ai/llm-api?utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=github_link), [Replicate](https://replicate.com/collections/streaming-language-models). - [Prompt Templates](./core/llm/index.ts) - In this file you'll find the `autodetectTemplateType` function. Make sure that for the model name you just added, this function returns the correct template type. This is assuming that the chat template for that model is already built in Continue. If not, you will have to add the template type and corresponding edit and chat templates. ### Adding Pre-indexed Documentation diff --git a/docs/docs/customize/model-providers/more/novita.md b/docs/docs/customize/model-providers/more/novita.md index 841d3e11e2..02f7cefb5e 100644 --- a/docs/docs/customize/model-providers/more/novita.md +++ b/docs/docs/customize/model-providers/more/novita.md @@ -1,6 +1,6 @@ # Novita -[Novita AI](https://novita.ai) offers an affordable, reliable, and simple inference platform with scalable [LLM API](https://novita.ai/docs/model-api/reference/introduction.html), empowering developers to build AI applications. Try the [Novita AI Llama 3 API Demo](https://novita.ai/model-api/product/llm-api/playground/meta-llama-llama-3.1-70b-instruct) today!. You can sign up [here](https://novita.ai/user/login?&redirect=/&utm_source=github_continuedev), copy your API key on the [Key Management](https://novita.ai/settings/key-management), and then hit the play button on any model from the [Novita AI Models list](https://novita.ai/llm-api?utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=link). Change `~/.continue/config.json` to look like this: +[Novita AI](https://novita.ai?utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=github_link) offers an affordable, reliable, and simple inference platform with scalable [LLM API](https://novita.ai/docs/model-api/reference/introduction.html), empowering developers to build AI applications. Try the [Novita AI Llama 3 API Demo](https://novita.ai/model-api/product/llm-api/playground/meta-llama-llama-3.1-70b-instruct?utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=github_link) today!. You can sign up [here](https://novita.ai/user/login?&redirect=/&utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=github_link), copy your API key on the [Key Management](https://novita.ai/settings/key-management?utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=github_link), and then hit the play button on any model from the [Novita AI Models list](https://novita.ai/llm-api?utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=github_link). Change `~/.continue/config.json` to look like this: ```json title="config.json" { diff --git a/docs/docs/customize/tutorials/llama3.1.md b/docs/docs/customize/tutorials/llama3.1.md index 28decd81e5..38e90bee9f 100644 --- a/docs/docs/customize/tutorials/llama3.1.md +++ b/docs/docs/customize/tutorials/llama3.1.md @@ -74,9 +74,9 @@ Together AI provides fast and reliable inference of open-source models. You'll b ## Novita AI -[Novita AI](https://novita.ai) offers an affordable, reliable, and simple inference platform with scalable [LLM API](https://novita.ai/docs/model-api/reference/introduction.html), empowering developers to build AI applications. Try the [Novita AI Llama 3 API Demo](https://novita.ai/model-api/product/llm-api/playground/meta-llama-llama-3.1-70b-instruct) today! +[Novita AI](https://novita.ai?utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=github_link) offers an affordable, reliable, and simple inference platform with scalable [LLM API](https://novita.ai/docs/model-api/reference/introduction.html), empowering developers to build AI applications. Try the [Novita AI Llama 3 API Demo](https://novita.ai/model-api/product/llm-api/playground/meta-llama-llama-3.1-70b-instruct?utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=github_link) today! -1. Create an account [here](https://novita.ai/user/login?&redirect=/&utm_source=github_continuedev) +1. Create an account [here](https://novita.ai/user/login?&redirect=/&utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=github_link) 2. Copy your API key that appears on the welcome screen 3. Update your Continue config file like this: diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/more/novita.md b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/more/novita.md index 97adaa0815..fffdd195a3 100644 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/more/novita.md +++ b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/model-providers/more/novita.md @@ -1,6 +1,6 @@ # Novita -[Novita AI](https://novita.ai) 提供了一个经济实惠、可靠且简单的推理平台。你可以在 [这里](https://novita.ai/user/login?&redirect=/&utm_source=github_continuedev) 注册,在 [Key 管理页面](https://novita.ai/settings/key-management)复制你的 API key ,然后在 [Novita 模型列表](https://novita.ai/llm-api?utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=link) 的任何模型上点击 Try it now 按钮。修改 `~/.continue/config.json` 像这样: +[Novita AI](https://novita.ai?utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=github_link) 提供了一个经济实惠、可靠且简单的推理平台。你可以在 [这里](https://novita.ai/user/login?&redirect=/&utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=github_link) 注册,在 [Key Management](https://novita.ai/settings/key-management?utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=github_link)复制你的 API key ,然后在 [Novita 模型列表](https://novita.ai/llm-api?utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=github_link) 的任何模型上点击 Try it now 按钮。修改 `~/.continue/config.json` 像这样: ```json title="config.json" { diff --git a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/tutorials/llama3.1.md b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/tutorials/llama3.1.md index 126be8f502..dc285627a3 100644 --- a/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/tutorials/llama3.1.md +++ b/docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/customize/tutorials/llama3.1.md @@ -73,10 +73,10 @@ Together AI 提供开源模型的快速和可信任的推理。你可以以良 ## Novita AI -[Novita AI](https://novita.ai) 提供了一个经济实惠、可靠且简单的推理平台。你可以以良好的速度运行 405b 模型。 +[Novita AI](https://novita.ai?utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=github_link) 提供了一个经济实惠、可靠且简单的推理平台。你可以以良好的速度运行 405b 模型。 -1. 创建账号 [在这里](https://novita.ai/llm-api?utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=link) -2. 复制[Key Management](https://novita.ai/settings/key-management)中的你的 API key +1. 创建账号 [在这里](https://novita.ai/user/login?&redirect=/&utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=github_link) +2. 复制[Key Management](https://novita.ai/settings/key-management?utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=github_link)中的你的 API key 3. 更新你的 Continue 配置文件,像这样: ```json title="config.json" diff --git a/extensions/vscode/config_schema.json b/extensions/vscode/config_schema.json index 76eedf998f..3ae0e3cc5e 100644 --- a/extensions/vscode/config_schema.json +++ b/extensions/vscode/config_schema.json @@ -223,7 +223,7 @@ "### Bedrock Imported Models\nTo get started with Bedrock you need to sign up on AWS [here](https://aws.amazon.com/bedrock)", "### Sagemaker\nSagemaker is AWS' machine learning platform.", "### Together\nTogether is a hosted service that provides extremely fast streaming of open-source language models. To get started with Together:\n1. Obtain an API key from [here](https://together.ai)\n2. Paste below\n3. Select a model preset\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/togetherllm)", - "### Novita AI\n[Novita AI](https://novita.ai) offers an affordable, reliable, and simple inference platform with scalable [LLM APIs](https://novita.ai/docs/model-api/reference/introduction.html), empowering developers to build AI applications. To get started with Novita AI:\n1. Obtain an API key from [here](https://novita.ai/settings/key-management)\n2. Paste below\n3. Select a model preset\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/novitallm)", + "### Novita AI\n[Novita AI](https://novita.ai?utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=github_link) offers an affordable, reliable, and simple inference platform with scalable [LLM APIs](https://novita.ai/docs/model-api/reference/introduction.html), empowering developers to build AI applications. To get started with Novita AI:\n1. Obtain an API key from [here](https://novita.ai/settings/key-management?utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=github_link)\n2. Paste below\n3. Select a model preset\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/novita)", "### Ollama\nTo get started with Ollama, follow these steps:\n1. Download from [ollama.ai](https://ollama.ai/) and open the application\n2. Open a terminal and run `ollama run `. Example model names are `codellama:7b-instruct` or `llama2:7b-text`. You can find the full list [here](https://ollama.ai/library).\n3. Make sure that the model name used in step 2 is the same as the one in config.json (e.g. `model=\"codellama:7b-instruct\"`)\n4. Once the model has finished downloading, you can start asking questions through Continue.\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/ollama)", "### Huggingface TGI\n\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/huggingfacetgi)", "### Huggingface Inference API\n\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/huggingfaceinferenceapi)", @@ -1014,8 +1014,8 @@ "type": "string" } ], - "markdownDescription": "Select a pre-defined option, or find an exact model string from Novita AI [here](https://novita.ai/llm-api?utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=link).", - "x-intellij-html-description": "Select a pre-defined option, or find an exact model string from Novita AI here." + "markdownDescription": "Select a pre-defined option, or find an exact model string from Novita AI [here](https://novita.ai/llm-api?utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=github_link).", + "x-intellij-html-description": "Select a pre-defined option, or find an exact model string from Novita AI here." } } } diff --git a/gui/src/pages/AddNewModel/configs/providers.ts b/gui/src/pages/AddNewModel/configs/providers.ts index 8ef4129eb1..49b30e409f 100644 --- a/gui/src/pages/AddNewModel/configs/providers.ts +++ b/gui/src/pages/AddNewModel/configs/providers.ts @@ -411,7 +411,7 @@ Select the \`GPT-4o\` model below to complete your provider configuration, but n description: "Use Novita AI API for extremely fast streaming of open-source models", icon: "novita.png", - longDescription: `[Novita AI](https://novita.ai) offers an affordable, reliable, and simple inference platform with scalable [LLM APIs](https://novita.ai/docs/model-api/reference/introduction.html), empowering developers to build AI applications. To get started with Novita AI:\n1. Obtain an API key from [here](https://novita.ai)\n2. Paste below\n3. Select a model preset`, + longDescription: `[Novita AI](https://novita.ai?utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=github_link) offers an affordable, reliable, and simple inference platform with scalable [LLM APIs](https://novita.ai/docs/model-api/reference/introduction.html), empowering developers to build AI applications. To get started with Novita AI:\n1. Obtain an API key from [here](https://novita.ai/settings/key-management?utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=github_link)\n2. Paste below\n3. Select a model preset`, tags: [ModelProviderTags.RequiresApiKey, ModelProviderTags.OpenSource], params: { apiKey: "", @@ -432,7 +432,7 @@ Select the \`GPT-4o\` model below to complete your provider configuration, but n p.params.contextLength = 4096; return p; }), - apiKeyUrl: "https://novita.ai/settings/key-management", + apiKeyUrl: "https://novita.ai/settings/key-management?utm_source=github_continuedev&utm_medium=github_readme&utm_campaign=github_link", }, gemini: { title: "Google Gemini API", From d401a5c11fdf5b3267269ff3603f83318a9dd9ad Mon Sep 17 00:00:00 2001 From: vercel Date: Wed, 25 Dec 2024 14:45:14 +0800 Subject: [PATCH 6/6] feat: fix models --- core/llm/llms/Novita.ts | 6 +++++ extensions/vscode/config_schema.json | 3 ++- gui/src/pages/AddNewModel/configs/models.ts | 27 +++++++++++++++++++ .../pages/AddNewModel/configs/providers.ts | 2 +- 4 files changed, 36 insertions(+), 2 deletions(-) diff --git a/core/llm/llms/Novita.ts b/core/llm/llms/Novita.ts index 9121bd6c25..2f5c61b551 100644 --- a/core/llm/llms/Novita.ts +++ b/core/llm/llms/Novita.ts @@ -9,11 +9,17 @@ class Novita extends OpenAI { }; private static MODEL_IDS: { [name: string]: string } = { + "llama3-8b": "meta-llama/llama-3-8b-instruct", + "llama3-70b": "meta-llama/llama-3-70b-instruct", "llama3.1-8b": "meta-llama/llama-3.1-8b-instruct", "llama3.1-70b": "meta-llama/llama-3.1-70b-instruct", "llama3.1-405b": "meta-llama/llama-3.1-405b-instruct", + "llama3.2-1b": "meta-llama/llama-3.2-1b-instruct", "llama3.2-3b": "meta-llama/llama-3.2-3b-instruct", "llama3.2-11b": "meta-llama/llama-3.2-11b-vision-instruct", + "llama3.3-70b": "meta-llama/llama-3.3-70b-instruct", + "mistral-nemo": "mistralai/mistral-nemo", + "mistral-7b": "mistralai/mistral-7b-instruct", }; protected _convertModelName(model: string) { diff --git a/extensions/vscode/config_schema.json b/extensions/vscode/config_schema.json index 3ae0e3cc5e..0bd81a53e7 100644 --- a/extensions/vscode/config_schema.json +++ b/extensions/vscode/config_schema.json @@ -1003,9 +1003,10 @@ "llama3.1-8b", "llama3.1-70b", "llama3.1-405b", + "llama3.2-1b", "llama3.2-3b", "llama3.2-11b", - "llama-3.3-70b", + "llama3.3-70b", "mistral-nemo", "mistral-7b" ] diff --git a/gui/src/pages/AddNewModel/configs/models.ts b/gui/src/pages/AddNewModel/configs/models.ts index d43ed2ec1f..d3ca71c5db 100644 --- a/gui/src/pages/AddNewModel/configs/models.ts +++ b/gui/src/pages/AddNewModel/configs/models.ts @@ -58,6 +58,33 @@ export const models: { [key: string]: ModelPackage } = { ], isOpenSource: true, }, + mistralChat: { + title: "Mistral Chat", + description: + "A series of open-weight models created by Mistral AI, highly competent for code generation and other tasks", + params: { + title: "Mistral", + model: "mistralai/mistral-7b-instruct", + contextLength: 4096, + }, + dimensions: [ + { + name: "Parameter Count", + description: "The number of parameters in the model", + options: { + "7b": { + model: "mistralai/mistral-7b-instruct", + title: "Mistral-7b", + }, + }, + }, + ], + icon: "mistral.png", + providerOptions: [ + "novita", + ], + isOpenSource: true, + }, llama31Chat: { title: "Llama3.1 Chat", description: "A model from Meta, fine-tuned for chat", diff --git a/gui/src/pages/AddNewModel/configs/providers.ts b/gui/src/pages/AddNewModel/configs/providers.ts index 49b30e409f..f294829757 100644 --- a/gui/src/pages/AddNewModel/configs/providers.ts +++ b/gui/src/pages/AddNewModel/configs/providers.ts @@ -427,7 +427,7 @@ Select the \`GPT-4o\` model below to complete your provider configuration, but n ...completionParamsInputsConfigs, ], packages: [ - models.llama318BChat, + models.llama318BChat, models.mistralChat ].map((p) => { p.params.contextLength = 4096; return p;