From c8ce3df4aa4af09a7babfd2251837024ecbe2acd Mon Sep 17 00:00:00 2001 From: Sahand Sojoodi Date: Tue, 8 Oct 2024 19:58:44 -0400 Subject: [PATCH] Fixes to support Cerebras Llama3.1 8b and 70b --- core/llm/llms/Cerebras.ts | 2 +- docs/static/schemas/config.json | 23 +++++++++++-- extensions/vscode/continue_rc_schema.json | 30 +++++++++++++++-- gui/public/logos/cerebras.png | Bin 0 -> 2947 bytes gui/src/pages/AddNewModel/configs/models.ts | 1 + .../pages/AddNewModel/configs/providers.ts | 31 ++++++++++++++++++ 6 files changed, 82 insertions(+), 5 deletions(-) create mode 100644 gui/public/logos/cerebras.png diff --git a/core/llm/llms/Cerebras.ts b/core/llm/llms/Cerebras.ts index 103994221..4b0a1752c 100644 --- a/core/llm/llms/Cerebras.ts +++ b/core/llm/llms/Cerebras.ts @@ -10,7 +10,7 @@ class Cerebras extends OpenAI { private static modelConversion: { [key: string]: string } = { "llama3.1-8b": "llama3.1-8b", - "llama3.1-70b": "llama-3.1-70b", + "llama3.1-70b": "llama3.1-70b", }; protected _convertModelName(model: string): string { return Cerebras.modelConversion[model] ?? model; diff --git a/docs/static/schemas/config.json b/docs/static/schemas/config.json index 77de3cf8a..87b026e38 100644 --- a/docs/static/schemas/config.json +++ b/docs/static/schemas/config.json @@ -194,7 +194,8 @@ "openrouter", "sambanova", "nvidia", - "vllm" + "vllm", + "cerebras" ], "markdownEnumDescriptions": [ "### OpenAI\nUse gpt-4, gpt-3.5-turbo, or any other OpenAI model. See [here](https://openai.com/product#made-for-developers) to obtain an API key.\n\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/openai)", @@ -224,7 +225,8 @@ "### IBM watsonx\nwatsonx, developed by IBM, offers a variety of pre-trained AI foundation models that can be used for natural language processing (NLP), computer vision, and speech recognition tasks.", "### OpenRouter\nOpenRouter offers a single API to access almost any language model. To get started, obtain an API key from [their console](https://openrouter.ai/settings/keys).", "### NVIDIA NIMs\nNVIDIA offers a single API to access almost any language model. To find out more, visit the [LLM APIs Documentation](https://docs.api.nvidia.com/nim/reference/llm-apis).\nFor information specific to getting a key, please check out the [docs here](https://docs.nvidia.com/nim/large-language-models/latest/getting-started.html#option-1-from-api-catalog)", - "### vLLM\nvLLM is a highly performant way of hosting LLMs for a team. To get started, follow their [quickstart](https://docs.vllm.ai/en/latest/getting_started/quickstart.html) to set up your server." + "### vLLM\nvLLM is a highly performant way of hosting LLMs for a team. To get started, follow their [quickstart](https://docs.vllm.ai/en/latest/getting_started/quickstart.html) to set up your server.", + "### Cerebras\nCerebras Inference uses specialized silicon to provides superfast inference. To get started, get your API keys from [their console](https://cloud.cerebras.ai/)." ], "type": "string" }, @@ -1142,6 +1144,23 @@ } } }, + { + "if": { + "properties": { + "provider": { + "enum": ["cerebras"] + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "model": { + "enum": ["llama3.1-8b", "llama3.1-70b"] + } + } + } + }, { "if": { "properties": { diff --git a/extensions/vscode/continue_rc_schema.json b/extensions/vscode/continue_rc_schema.json index 21f27ca4a..00ac4ff95 100644 --- a/extensions/vscode/continue_rc_schema.json +++ b/extensions/vscode/continue_rc_schema.json @@ -197,7 +197,8 @@ "openrouter", "sambanova", "nvidia", - "vllm" + "vllm", + "cerebras" ], "markdownEnumDescriptions": [ "### OpenAI\nUse gpt-4, gpt-3.5-turbo, or any other OpenAI model. See [here](https://openai.com/product#made-for-developers) to obtain an API key.\n\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/openai)", @@ -227,7 +228,8 @@ "### IBM watsonx\nwatsonx, developed by IBM, offers a variety of pre-trained AI foundation models that can be used for natural language processing (NLP), computer vision, and speech recognition tasks.", "### OpenRouter\nOpenRouter offers a single API to access almost any language model. To get started, obtain an API key from [their console](https://openrouter.ai/settings/keys).", "### NVIDIA NIMs\nNVIDIA offers a single API to access almost any language model. To find out more, visit the [LLM APIs Documentation](https://docs.api.nvidia.com/nim/reference/llm-apis).\nFor information specific to getting a key, please check out the [docs here](https://docs.nvidia.com/nim/large-language-models/latest/getting-started.html#option-1-from-api-catalog)", - "### vLLM\nvLLM is a highly performant way of hosting LLMs for a team. To get started, follow their [quickstart](https://docs.vllm.ai/en/latest/getting_started/quickstart.html) to set up your server." + "### vLLM\nvLLM is a highly performant way of hosting LLMs for a team. To get started, follow their [quickstart](https://docs.vllm.ai/en/latest/getting_started/quickstart.html) to set up your server.", + "### Cerebras\nCerebras Inference uses specialized silicon to provides superfast inference. To get started, get your API keys from [their console](https://cloud.cerebras.ai/)." ], "type": "string" }, @@ -1265,6 +1267,30 @@ } } }, + { + "if": { + "properties": { + "provider": { + "enum": [ + "cerebras" + ] + } + }, + "required": [ + "provider" + ] + }, + "then": { + "properties": { + "model": { + "enum": [ + "llama3.1-8b", + "llama3.1-70b" + ] + } + } + } + }, { "if": { "properties": { diff --git a/gui/public/logos/cerebras.png b/gui/public/logos/cerebras.png new file mode 100644 index 0000000000000000000000000000000000000000..024dc5b7dccc6b6365962711c1e8dd9c3c6d0c19 GIT binary patch literal 2947 zcmY*bc|6qJ8Xr?(CQD3~n3}Ovgqv((EK#;Qdb_>%p7VLm^F7b+`+T4CoIlRzm*C`JB?y)R0{{R)8*6hH zu7~d$KQDKsL`JS~9S_CD3Js`aL#Mf$D>#fzki9)Xg^T$C`*=hFdv+<@3E+_e?E8rU zfRjAZzp)FC(k~7W0QeUHu=f|oi|coXHP^V=zx*C1&p(Px;BPjZx#u6eo95pjyvTK+ zP-{;L0I(mjYdnD4d6HZ;Pl6kUim|sd2qc9duxCgCI0P*ubT+7J`-f%Vs7~>ox3xZ z#Z#%F21sN?Lo zAQ9oay4V0x7}Z!-cDK;)@%K5YgrI*a5h=gg;x>rf{esj$ppd_{xv56GQ3FRZ0mrSp zt8b!V^pp92v0rtJkh{hI=P-YF`ZLOH)dXyW{C#aE;6r|6eB6uIvN1Pv!+>sh5JKHO z4qal`uPNB0-O&&^&acfcHF=Qx`$=0>ao09o%!UOk-_C48#8nfP-6QXBuGHcTPE1RN z^IJ0KjN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B!H4-59!Sq0| z=fqLP2LYgMcez{W1BXSfZrSDXA<~$2(UKHJ%Ukz>w12-HnJ~5ROg4HS9vl@lF@JzK z_}z<=+94*Ew%m4IO0Hl#boOiZ7t1!JksRUb3b{q0EN*|WiiOmOhIhx%Q(?LO0aItL-CSF|V9-r{ zn$7!BCja3uWj0^aG5HXWojQAy&c-vcprwDIk=bnEk#jcd=jxX4-BK UkjQyfz56F>W8q+4i9Q|sA83a5p8x;= literal 0 HcmV?d00001 diff --git a/gui/src/pages/AddNewModel/configs/models.ts b/gui/src/pages/AddNewModel/configs/models.ts index 5a70ad8d1..f3e0b9cfe 100644 --- a/gui/src/pages/AddNewModel/configs/models.ts +++ b/gui/src/pages/AddNewModel/configs/models.ts @@ -68,6 +68,7 @@ export const models: { [key: string]: ModelPackage } = { "llama.cpp", "replicate", "sambanova", + "cerebras", ], isOpenSource: true, }, diff --git a/gui/src/pages/AddNewModel/configs/providers.ts b/gui/src/pages/AddNewModel/configs/providers.ts index 155905fbc..1bca2efff 100644 --- a/gui/src/pages/AddNewModel/configs/providers.ts +++ b/gui/src/pages/AddNewModel/configs/providers.ts @@ -595,4 +595,35 @@ To get started, [register](https://dataplatform.cloud.ibm.com/registration/stepo }), apiKeyUrl: "https://cloud.sambanova.ai/apis", }, + cerebras: { + title: "Cerebras", + provider: "cerebras", + icon: "cerebras.png", + description: + "Cerebras Inference is a custom silicon for fast inference of LLM models.", + longDescription: + "Get your API key [here](https://cloud.cerebras.ai/).", + tags: [ModelProviderTags.RequiresApiKey, ModelProviderTags.OpenSource], + collectInputFor: [ + { + inputType: "text", + key: "apiKey", + label: "API Key", + placeholder: "Enter your Cerebras API key", + required: true, + }, + ], + packages: [ + models.llama3170bChat, + models.llama318bChat, + { + ...models.AUTODETECT, + params: { + ...models.AUTODETECT.params, + title: "Cerebras", + }, + }, + ], + apiKeyUrl: "https://cloud.cerebras.ai/", + }, };