diff --git a/.vscode/tasks.json b/.vscode/tasks.json index fb4e1241d..8331b5380 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -41,7 +41,7 @@ "background": { "activeOnStart": true, "beginsPattern": ">", - "endsPattern": "node scripts/esbuild.js --sourcemap --watch" + "endsPattern": "VS Code Extension esbuild complete" } } ] diff --git a/core/index.d.ts b/core/index.d.ts index 133270873..5b0b892f6 100644 --- a/core/index.d.ts +++ b/core/index.d.ts @@ -48,9 +48,9 @@ export interface IndexingProgressUpdate { export type PromptTemplate = | string | (( - history: ChatMessage[], - otherData: Record, - ) => string | ChatMessage[]); + history: ChatMessage[], + otherData: Record, + ) => string | ChatMessage[]); export interface ILLM extends LLMOptions { get providerName(): ModelProvider; @@ -646,7 +646,8 @@ type ModelProvider = | "cerebras" | "askSage" | "vertexai" - | "nebius"; + | "nebius" + | "xAI"; export type ModelName = | "AUTODETECT" @@ -696,6 +697,8 @@ export type ModelName = | "llama3.2-3b" | "llama3.2-11b" | "llama3.2-90b" + // xAI + | "grok-beta" // Other Open-source | "phi2" | "phind-codellama-34b" @@ -1054,9 +1057,9 @@ export interface Config { embeddingsProvider?: EmbeddingsProviderDescription | EmbeddingsProvider; /** The model that Continue will use for tab autocompletions. */ tabAutocompleteModel?: - | CustomLLM - | ModelDescription - | (CustomLLM | ModelDescription)[]; + | CustomLLM + | ModelDescription + | (CustomLLM | ModelDescription)[]; /** Options for tab autocomplete */ tabAutocompleteOptions?: Partial; /** UI styles customization */ diff --git a/core/llm/autodetect.ts b/core/llm/autodetect.ts index c6b1874c3..64e0634a5 100644 --- a/core/llm/autodetect.ts +++ b/core/llm/autodetect.ts @@ -146,7 +146,8 @@ function autodetectTemplateType(model: string): TemplateType | undefined { lower.includes("command") || lower.includes("chat-bison") || lower.includes("pplx") || - lower.includes("gemini") + lower.includes("gemini") || + lower.includes("grok") ) { return undefined; } diff --git a/core/llm/llms/index.ts b/core/llm/llms/index.ts index 4a6b1d539..64882b09b 100644 --- a/core/llm/llms/index.ts +++ b/core/llm/llms/index.ts @@ -45,6 +45,7 @@ import WatsonX from "./WatsonX"; import ContinueProxy from "./stubs/ContinueProxy"; import VertexAI from "./VertexAI"; import Asksage from "./Asksage"; +import xAI from "./xAI"; const LLMs = [ Anthropic, @@ -84,7 +85,8 @@ const LLMs = [ Cerebras, Asksage, Nebius, - VertexAI + VertexAI, + xAI ]; export async function llmFromDescription( diff --git a/core/llm/llms/xAI.ts b/core/llm/llms/xAI.ts new file mode 100644 index 000000000..aa33ee70d --- /dev/null +++ b/core/llm/llms/xAI.ts @@ -0,0 +1,20 @@ +import { LLMOptions, ModelProvider } from "../../index.js"; + +import OpenAI from "./OpenAI.js"; + +class xAI extends OpenAI { + static providerName: ModelProvider = "xAI"; + static defaultOptions: Partial = { + apiBase: "https://api.x.ai/v1/", + }; + + private static MODEL_IDS: { [name: string]: string } = { + "grok-beta": "grok-beta", // Future names might not line up + }; + + protected _convertModelName(model: string) { + return xAI.MODEL_IDS[model] || this.model; + } +} + +export default xAI; diff --git a/docs/docs/customize/model-providers/top-level/xAI.md b/docs/docs/customize/model-providers/top-level/xAI.md new file mode 100644 index 000000000..fbdfa83ad --- /dev/null +++ b/docs/docs/customize/model-providers/top-level/xAI.md @@ -0,0 +1,53 @@ +--- +title: xAI +slug: ../xai +--- + +:::info + +You can get an API key from the [xAI console](https://console.x.ai/) + +::: + +## Chat model + +We recommend configuring **grok-beta** as your chat model. + +```json title="config.json" +{ + "models": [ + { + "title": "Grok Beta", + "provider": "xAI", + "model": "grok-beta", + "apiKey": "[API_KEY]" + } + ] +} +``` + +## Autocomplete model + +xAI currently does not offer any autocomplete models. + +[Click here](../../model-types/autocomplete.md) to see a list of autocomplete model providers. + +## Embeddings model + +xAI currently does not offer any embeddings models. + +[Click here](../../model-types/embeddings.md) to see a list of embeddings model providers. + +## Reranking model + +xAI currently does not offer any reranking models. + +[Click here](../../model-types/reranking.md) to see a list of reranking model providers. + +## Legacy Completions + +To force usage of `chat/completions` instead of `completions` endpoint you can set + +```json +"useLegacyCompletionsEndpoint": false +``` diff --git a/extensions/vscode/config_schema.json b/extensions/vscode/config_schema.json index dc9fc66fa..3aa9906a2 100644 --- a/extensions/vscode/config_schema.json +++ b/extensions/vscode/config_schema.json @@ -88,7 +88,10 @@ "type": "string" } }, - "required": ["cert", "key"] + "required": [ + "cert", + "key" + ] }, "RequestOptions": { "title": "RequestOptions", @@ -198,7 +201,8 @@ "cerebras", "askSage", "nebius", - "vertexai" + "vertexai", + "xAI" ], "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)", @@ -233,7 +237,8 @@ "### 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.", "### Cerebras\nCerebras Inference uses specialized silicon to provides superfast inference. To get started, get your API keys from [their console](https://cloud.cerebras.ai/).", - "### Ask Sage\nAsk Sage is an agnostic hosted service that provides language models. To get started with Ask Sage:\n1. Obtain an API key from your account. For more information, visit [Ask Sage](https://docs.asksage.ai/).\n2. Paste the API key below.\n3. Select a model preset.\n> [Reference](https://docs.asksage.ai/)" + "### Ask Sage\nAsk Sage is an agnostic hosted service that provides language models. To get started with Ask Sage:\n1. Obtain an API key from your account. For more information, visit [Ask Sage](https://docs.asksage.ai/).\n2. Paste the API key below.\n3. Select a model preset.\n> [Reference](https://docs.asksage.ai/)", + "### xAI offers a world class developer tool set to build scalable applications powered by Grok. To get started, obtain an API key from [the x Console](https://console.x.ai/), and see the [docs](https://docs.x.ai/docs/)" ], "type": "string" }, @@ -401,7 +406,10 @@ "title": "Api Type", "markdownDescription": "OpenAI API type, either `openai` or `azure`", "x-intellij-html-description": "OpenAI API type, either openai or azure", - "enum": ["openai", "azure"] + "enum": [ + "openai", + "azure" + ] }, "apiVersion": { "title": "Api Version", @@ -424,7 +432,11 @@ } } }, - "required": ["title", "provider", "model"], + "required": [ + "title", + "provider", + "model" + ], "allOf": [ { "if": { @@ -434,7 +446,9 @@ } }, "not": { - "required": ["provider"] + "required": [ + "provider" + ] } }, "then": { @@ -459,50 +473,72 @@ "together", "cloudflare", "sambanova", - "nebius" + "nebius", + "xAI" ] } }, - "required": ["provider"] + "required": [ + "provider" + ] }, "then": { - "required": ["apiKey"] + "required": [ + "apiKey" + ] } }, { "if": { "properties": { "provider": { - "enum": ["bedrockimport"] + "enum": [ + "bedrockimport" + ] } }, - "required": ["provider"] + "required": [ + "provider" + ] }, "then": { - "required": ["modelArn"] + "required": [ + "modelArn" + ] } }, { "if": { "properties": { "provider": { - "enum": ["huggingface-tgi", "huggingface-inference-api"] + "enum": [ + "huggingface-tgi", + "huggingface-inference-api" + ] } } }, "then": { - "required": ["apiBase"] + "required": [ + "apiBase" + ] }, - "required": ["provider"] + "required": [ + "provider" + ] }, { "if": { "properties": { "provider": { - "enum": ["openai"] + "enum": [ + "openai" + ] } }, - "required": ["provider"] + "required": [ + "provider" + ] }, "then": { "properties": { @@ -522,10 +558,14 @@ "if": { "properties": { "provider": { - "enum": ["cloudflare"] + "enum": [ + "cloudflare" + ] } }, - "required": ["provider"] + "required": [ + "provider" + ] }, "then": { "properties": { @@ -583,10 +623,14 @@ "if": { "properties": { "provider": { - "enum": ["openai"] + "enum": [ + "openai" + ] } }, - "required": ["provider"] + "required": [ + "provider" + ] }, "then": { "properties": { @@ -618,10 +662,45 @@ "if": { "properties": { "provider": { - "enum": ["replicate"] + "enum": [ + "xAI" + ] } }, - "required": ["provider"] + "required": [ + "provider" + ] + }, + "then": { + "properties": { + "model": { + "anyOf": [ + { + "enum": [ + "grok-beta", + "AUTODETECT" + ] + }, + { + "type": "string" + } + ] + } + } + } + }, + { + "if": { + "properties": { + "provider": { + "enum": [ + "replicate" + ] + } + }, + "required": [ + "provider" + ] }, "then": { "properties": { @@ -655,10 +734,14 @@ "if": { "properties": { "provider": { - "enum": ["free-trial"] + "enum": [ + "free-trial" + ] } }, - "required": ["provider"] + "required": [ + "provider" + ] }, "then": { "properties": { @@ -682,7 +765,9 @@ "if": { "properties": { "provider": { - "enum": ["openai"] + "enum": [ + "openai" + ] }, "apiType": { "not": { @@ -690,7 +775,9 @@ } } }, - "required": ["provider"] + "required": [ + "provider" + ] }, "then": { "properties": { @@ -752,10 +839,14 @@ "if": { "properties": { "provider": { - "enum": ["anthropic"] + "enum": [ + "anthropic" + ] } }, - "required": ["provider"] + "required": [ + "provider" + ] }, "then": { "properties": { @@ -796,15 +887,22 @@ "if": { "properties": { "provider": { - "enum": ["cohere"] + "enum": [ + "cohere" + ] } }, - "required": ["provider"] + "required": [ + "provider" + ] }, "then": { "properties": { "model": { - "enum": ["command-r", "command-r-plus"] + "enum": [ + "command-r", + "command-r-plus" + ] } } } @@ -813,10 +911,14 @@ "if": { "properties": { "provider": { - "enum": ["bedrock"] + "enum": [ + "bedrock" + ] } }, - "required": ["provider"] + "required": [ + "provider" + ] }, "then": { "properties": { @@ -841,10 +943,14 @@ "if": { "properties": { "provider": { - "enum": ["sagemaker"] + "enum": [ + "sagemaker" + ] } }, - "required": ["provider"] + "required": [ + "provider" + ] }, "then": { "properties": { @@ -858,10 +964,14 @@ "if": { "properties": { "provider": { - "enum": ["gemini"] + "enum": [ + "gemini" + ] } }, - "required": ["provider"] + "required": [ + "provider" + ] }, "then": { "properties": { @@ -891,10 +1001,14 @@ "if": { "properties": { "provider": { - "enum": ["together"] + "enum": [ + "together" + ] } }, - "required": ["provider"] + "required": [ + "provider" + ] }, "then": { "properties": { @@ -932,10 +1046,14 @@ "if": { "properties": { "provider": { - "enum": ["deepinfra"] + "enum": [ + "deepinfra" + ] } }, - "required": ["provider"] + "required": [ + "provider" + ] }, "then": { "properties": { @@ -959,7 +1077,9 @@ ] } }, - "required": ["provider"] + "required": [ + "provider" + ] }, "then": { "properties": { @@ -1008,10 +1128,14 @@ "if": { "properties": { "provider": { - "enum": ["ollama"] + "enum": [ + "ollama" + ] } }, - "required": ["provider"] + "required": [ + "provider" + ] }, "then": { "properties": { @@ -1063,10 +1187,14 @@ "if": { "properties": { "provider": { - "enum": ["mistral"] + "enum": [ + "mistral" + ] } }, - "required": ["provider"] + "required": [ + "provider" + ] }, "then": { "properties": { @@ -1088,23 +1216,34 @@ "if": { "properties": { "provider": { - "enum": ["vertexai"] + "enum": [ + "vertexai" + ] } }, - "required": ["provider"] + "required": [ + "provider" + ] }, "then": { - "required": ["projectId", "region"] + "required": [ + "projectId", + "region" + ] } }, { "if": { "properties": { "provider": { - "enum": ["deepseek"] + "enum": [ + "deepseek" + ] } }, - "required": ["provider"] + "required": [ + "provider" + ] }, "then": { "properties": { @@ -1121,7 +1260,10 @@ } }, "model": { - "enum": ["deepseek-chat", "deepseek-coder"] + "enum": [ + "deepseek-chat", + "deepseek-coder" + ] } } } @@ -1130,10 +1272,14 @@ "if": { "properties": { "provider": { - "enum": ["groq"] + "enum": [ + "groq" + ] } }, - "required": ["provider"] + "required": [ + "provider" + ] }, "then": { "properties": { @@ -1158,15 +1304,21 @@ "if": { "properties": { "provider": { - "enum": ["fireworks"] + "enum": [ + "fireworks" + ] } }, - "required": ["provider"] + "required": [ + "provider" + ] }, "then": { "properties": { "model": { - "enum": ["starcoder-7b"] + "enum": [ + "starcoder-7b" + ] } } } @@ -1178,20 +1330,29 @@ "const": "azure" } }, - "required": ["apiType"] + "required": [ + "apiType" + ] }, "then": { - "required": ["deployment", "apiBase"] + "required": [ + "deployment", + "apiBase" + ] } }, { "if": { "properties": { "provider": { - "enum": ["openai"] + "enum": [ + "openai" + ] } }, - "required": ["provider"] + "required": [ + "provider" + ] }, "then": { "properties": { @@ -1208,7 +1369,9 @@ "const": "llamafile" } }, - "required": ["provider"] + "required": [ + "provider" + ] }, "then": { "properties": { @@ -1222,15 +1385,22 @@ "if": { "properties": { "provider": { - "enum": ["cerebras"] + "enum": [ + "cerebras" + ] } }, - "required": ["provider"] + "required": [ + "provider" + ] }, "then": { "properties": { "model": { - "enum": ["llama3.1-8b", "llama3.1-70b"] + "enum": [ + "llama3.1-8b", + "llama3.1-70b" + ] } } } @@ -1239,10 +1409,14 @@ "if": { "properties": { "provider": { - "enum": ["text-gen-webui"] + "enum": [ + "text-gen-webui" + ] } }, - "required": ["provider"] + "required": [ + "provider" + ] }, "then": { "properties": { @@ -1256,10 +1430,14 @@ "if": { "properties": { "provider": { - "enum": ["flowise"] + "enum": [ + "flowise" + ] } }, - "required": ["provider"] + "required": [ + "provider" + ] }, "then": { "properties": { @@ -1286,7 +1464,10 @@ "type": "string" } }, - "required": ["key", "value"] + "required": [ + "key", + "value" + ] } }, "additionalFlowiseConfiguration": { @@ -1305,7 +1486,10 @@ "description": "Configuration Property value" } }, - "required": ["key", "value"] + "required": [ + "key", + "value" + ] } }, "model": { @@ -1380,10 +1564,14 @@ "if": { "properties": { "provider": { - "enum": ["watsonx"] + "enum": [ + "watsonx" + ] } }, - "required": ["provider"] + "required": [ + "provider" + ] }, "then": { "properties": { @@ -1419,24 +1607,36 @@ ] } }, - "required": ["apiBase", "apiKey", "apiVersion"] + "required": [ + "apiBase", + "apiKey", + "apiVersion" + ] } }, { "if": { "properties": { "provider": { - "enum": ["sambanova"] + "enum": [ + "sambanova" + ] } }, - "required": ["provider"] + "required": [ + "provider" + ] }, "then": { "properties": { "model": { "anyOf": [ { - "enum": ["llama3.1-8b", "llama3.1-70b", "llama3.1-405b"] + "enum": [ + "llama3.1-8b", + "llama3.1-70b", + "llama3.1-405b" + ] }, { "type": "string" @@ -1451,10 +1651,14 @@ "if": { "properties": { "provider": { - "enum": ["ask-sage"] + "enum": [ + "ask-sage" + ] } }, - "required": ["provider"] + "required": [ + "provider" + ] }, "then": { "properties": { @@ -1509,7 +1713,9 @@ "type": "string" } }, - "required": ["default"] + "required": [ + "default" + ] }, "SlashCommand": { "title": "SlashCommand", @@ -1566,7 +1772,9 @@ "if": { "properties": { "name": { - "enum": ["issue"] + "enum": [ + "issue" + ] } } }, @@ -1579,17 +1787,23 @@ "description": "Enter the URL of the GitHub repository for which you want to generate the issue." } }, - "required": ["repositoryUrl"] + "required": [ + "repositoryUrl" + ] } }, - "required": ["params"] + "required": [ + "params" + ] } }, { "if": { "properties": { "name": { - "enum": ["edit"] + "enum": [ + "edit" + ] } } }, @@ -1615,7 +1829,9 @@ "if": { "properties": { "name": { - "enum": ["share"] + "enum": [ + "share" + ] } } }, @@ -1637,7 +1853,9 @@ "if": { "properties": { "name": { - "enum": ["commit"] + "enum": [ + "commit" + ] } } }, @@ -1656,7 +1874,10 @@ } } ], - "required": ["name", "description"] + "required": [ + "name", + "description" + ] }, "CustomCommand": { "title": "CustomCommand", @@ -1675,7 +1896,11 @@ "type": "string" } }, - "required": ["name", "prompt", "description"] + "required": [ + "name", + "prompt", + "description" + ] }, "ContextProviderWithParams": { "title": "ContextProviderWithParams", @@ -1755,7 +1980,9 @@ "if": { "properties": { "name": { - "enum": ["discord"] + "enum": [ + "discord" + ] } } }, @@ -1788,11 +2015,15 @@ "description": "The name of the channel" } }, - "required": ["id"] + "required": [ + "id" + ] } } }, - "required": ["discordKey"] + "required": [ + "discordKey" + ] } } }, @@ -1801,14 +2032,18 @@ { "properties": { "params": { - "required": ["guildId"] + "required": [ + "guildId" + ] } } }, { "properties": { "params": { - "required": ["channels"] + "required": [ + "channels" + ] } } } @@ -1821,7 +2056,9 @@ "if": { "properties": { "name": { - "enum": ["google"] + "enum": [ + "google" + ] } } }, @@ -1834,17 +2071,23 @@ "description": "Your API key for https://serper.dev in order to get Google search results" } }, - "required": ["serperApiKey"] + "required": [ + "serperApiKey" + ] } }, - "required": ["params"] + "required": [ + "params" + ] } }, { "if": { "properties": { "name": { - "enum": ["web"] + "enum": [ + "web" + ] } } }, @@ -1861,14 +2104,18 @@ } } }, - "required": ["params"] + "required": [ + "params" + ] } }, { "if": { "properties": { "name": { - "enum": ["open"] + "enum": [ + "open" + ] } } }, @@ -1890,7 +2137,9 @@ "if": { "properties": { "name": { - "enum": ["issue"] + "enum": [ + "issue" + ] } } }, @@ -1919,24 +2168,37 @@ "type": { "type": "string", "description": "The type of issues to search for", - "enum": ["open", "closed", "all"] + "enum": [ + "open", + "closed", + "all" + ] } }, - "required": ["owner", "repo"] + "required": [ + "owner", + "repo" + ] } } }, - "required": ["repos"] + "required": [ + "repos" + ] } }, - "required": ["params"] + "required": [ + "params" + ] } }, { "if": { "properties": { "name": { - "enum": ["database"] + "enum": [ + "database" + ] } } }, @@ -1957,7 +2219,11 @@ "connection_type": { "type": "string", "description": "The type of database (e.g., 'postgres', 'mysql')", - "enum": ["postgres", "mysql", "sqlite"] + "enum": [ + "postgres", + "mysql", + "sqlite" + ] }, "connection": { "type": "object", @@ -1990,21 +2256,31 @@ "required": [] } }, - "required": ["name", "connection_type", "connection"] + "required": [ + "name", + "connection_type", + "connection" + ] } } }, - "required": ["connections"] + "required": [ + "connections" + ] } }, - "required": ["params"] + "required": [ + "params" + ] } }, { "if": { "properties": { "name": { - "enum": ["gitlab-mr"] + "enum": [ + "gitlab-mr" + ] } } }, @@ -2025,17 +2301,23 @@ "description": "If you have code selected, filters out comments that aren't related to the selection." } }, - "required": ["token"] + "required": [ + "token" + ] } }, - "required": ["params"] + "required": [ + "params" + ] } }, { "if": { "properties": { "name": { - "enum": ["jira"] + "enum": [ + "jira" + ] } } }, @@ -2082,17 +2364,24 @@ ] } }, - "required": ["domain", "token"] + "required": [ + "domain", + "token" + ] } }, - "required": ["params"] + "required": [ + "params" + ] } }, { "if": { "properties": { "name": { - "enum": ["http"] + "enum": [ + "http" + ] } } }, @@ -2110,17 +2399,24 @@ "type": "object" } }, - "required": ["url"] + "required": [ + "url" + ] } }, - "required": ["params"] + "required": [ + "params" + ] } }, { "if": { "properties": { "name": { - "enum": ["codebase", "folder"] + "enum": [ + "codebase", + "folder" + ] } } }, @@ -2155,7 +2451,9 @@ "if": { "properties": { "name": { - "enum": ["postgres"] + "enum": [ + "postgres" + ] } } }, @@ -2207,14 +2505,22 @@ } } }, - "required": ["host", "port", "user", "password", "database"] + "required": [ + "host", + "port", + "user", + "password", + "database" + ] } }, { "if": { "properties": { "name": { - "enum": ["greptile"] + "enum": [ + "greptile" + ] } } }, @@ -2237,11 +2543,16 @@ } } }, - "required": ["GreptileToken", "GithubToken"] + "required": [ + "GreptileToken", + "GithubToken" + ] } } ], - "required": ["name"] + "required": [ + "name" + ] }, "SerializedContinueConfig": { "title": "config.json", @@ -2275,7 +2586,10 @@ "description": "The URL path to a favicon for the site - by default, it will be `/favicon.ico` path from the Start URL" } }, - "required": ["title", "startUrl"] + "required": [ + "title", + "startUrl" + ] } }, "allowAnonymousTelemetry": { @@ -2451,29 +2765,44 @@ "type": "string" } }, - "required": ["provider"], + "required": [ + "provider" + ], "allOf": [ { "if": { "properties": { "provider": { - "enum": ["cohere", "voyage", "nvidia", "gemini"] + "enum": [ + "cohere", + "voyage", + "nvidia", + "gemini" + ] } }, - "required": ["provider"] + "required": [ + "provider" + ] }, "then": { - "required": ["apiKey"] + "required": [ + "apiKey" + ] } }, { "if": { "properties": { "provider": { - "enum": ["sagemaker"] + "enum": [ + "sagemaker" + ] } }, - "required": ["provider"] + "required": [ + "provider" + ] }, "then": { "properties": { @@ -2481,17 +2810,23 @@ "description": "SageMaker endpoint name" } }, - "required": ["model"] + "required": [ + "model" + ] } }, { "if": { "properties": { "provider": { - "enum": ["vertexai"] + "enum": [ + "vertexai" + ] } }, - "required": ["provider"] + "required": [ + "provider" + ] }, "then": { "properties": { @@ -2506,7 +2841,11 @@ "default": "text-embedding-004" } }, - "required": ["projectId", "model", "region"] + "required": [ + "projectId", + "model", + "region" + ] } } ] @@ -2529,16 +2868,22 @@ "type": "object" } }, - "required": ["name"], + "required": [ + "name" + ], "allOf": [ { "if": { "properties": { "name": { - "enum": ["cohere"] + "enum": [ + "cohere" + ] } }, - "required": ["name"] + "required": [ + "name" + ] }, "then": { "properties": { @@ -2560,7 +2905,9 @@ "type": "string" } }, - "required": ["apiKey"] + "required": [ + "apiKey" + ] } } } @@ -2569,10 +2916,14 @@ "if": { "properties": { "name": { - "enum": ["llm"] + "enum": [ + "llm" + ] } }, - "required": ["name"] + "required": [ + "name" + ] }, "then": { "properties": { @@ -2583,7 +2934,9 @@ "type": "string" } }, - "required": ["modelTitle"] + "required": [ + "modelTitle" + ] } } } @@ -2592,10 +2945,14 @@ "if": { "properties": { "name": { - "enum": ["voyage"] + "enum": [ + "voyage" + ] } }, - "required": ["name"] + "required": [ + "name" + ] }, "then": { "properties": { @@ -2614,7 +2971,9 @@ ] } }, - "required": ["apiKey"] + "required": [ + "apiKey" + ] } } } @@ -2623,10 +2982,14 @@ "if": { "properties": { "name": { - "enum": ["huggingface-tei"] + "enum": [ + "huggingface-tei" + ] } }, - "required": ["name"] + "required": [ + "name" + ] }, "then": { "properties": { @@ -2646,12 +3009,17 @@ "default": false }, "truncation_direction": { - "enum": ["Right", "Left"], + "enum": [ + "Right", + "Left" + ], "description": "Whether to truncate sequences from the left or right.", "default": "Right" } }, - "required": ["apiBase"] + "required": [ + "apiBase" + ] } }, "if": { @@ -2662,7 +3030,9 @@ } }, "then": { - "required": ["truncation_direction"] + "required": [ + "truncation_direction" + ] } } } @@ -2733,7 +3103,11 @@ "description": "An optional template string to be used for autocomplete. It will be rendered with the Mustache templating language, and is passed the 'prefix' and 'suffix' variables." }, "multilineCompletions": { - "enum": ["always", "never", "auto"], + "enum": [ + "always", + "never", + "auto" + ], "description": "If set to true, Continue will only complete a single line at a time." }, "useCache": { @@ -2762,7 +3136,10 @@ "type": "object", "properties": { "codeBlockToolbarPosition": { - "enum": ["top", "bottom"], + "enum": [ + "top", + "bottom" + ], "default": "top", "description": "Whether to show the copy and apply code buttons at the top or bottom of code blocks in the sidebar." }, @@ -2788,7 +3165,10 @@ "properties": { "provider": { "type": "string", - "enum": ["posthog", "logstash"], + "enum": [ + "posthog", + "logstash" + ], "description": "The 3rd party analytics provider to use.", "default": "posthog", "markdownEnumDescriptions": [ @@ -2804,30 +3184,40 @@ "description": "The client key to use for analytics" } }, - "required": ["provider"], + "required": [ + "provider" + ], "allOf": [ { "if": { "properties": { "provider": { - "enum": ["posthog"] + "enum": [ + "posthog" + ] } } }, "then": { - "required": ["clientKey"] + "required": [ + "clientKey" + ] } }, { "if": { "properties": { "provider": { - "enum": ["logstash"] + "enum": [ + "logstash" + ] } } }, "then": { - "required": ["url"] + "required": [ + "url" + ] } } ] @@ -2899,7 +3289,10 @@ "default": false } }, - "required": ["prompt", "title"] + "required": [ + "prompt", + "title" + ] }, "description": "Quick actions are a way to add custom commands to the Code Lens of function and class declarations." }, @@ -2933,4 +3326,4 @@ } } } -} +} \ No newline at end of file diff --git a/extensions/vscode/scripts/esbuild.js b/extensions/vscode/scripts/esbuild.js index f3d2c09db..7e367bfaa 100644 --- a/extensions/vscode/scripts/esbuild.js +++ b/extensions/vscode/scripts/esbuild.js @@ -30,4 +30,5 @@ const esbuildConfig = { } else { await esbuild.build(esbuildConfig); } -})(); + console.log("VS Code Extension esbuild complete"); // Used in task endpattern to signal completion +})(); \ No newline at end of file diff --git a/gui/public/logos/xAI.png b/gui/public/logos/xAI.png new file mode 100644 index 000000000..95bdec71a Binary files /dev/null and b/gui/public/logos/xAI.png differ diff --git a/gui/src/pages/AddNewModel/configs/models.ts b/gui/src/pages/AddNewModel/configs/models.ts index b951d8673..87bdfc546 100644 --- a/gui/src/pages/AddNewModel/configs/models.ts +++ b/gui/src/pages/AddNewModel/configs/models.ts @@ -1059,6 +1059,19 @@ export const models: { [key: string]: ModelPackage } = { providerOptions: ["nebius"], isOpenSource: true, }, + grokBeta: { + title: "Grok Beta", + description: "Generative artificial intelligence chatbot developed by xAI.", + refUrl: "", + params: { + title: "Grok Beta", + model: "grok-beta", + contextLength: 128_000, + }, + icon: "xAI.png", + providerOptions: ["xAI"], + isOpenSource: false, + }, AUTODETECT: { title: "Autodetect", description: diff --git a/gui/src/pages/AddNewModel/configs/providers.ts b/gui/src/pages/AddNewModel/configs/providers.ts index 62f6905d1..dd1c3fbdb 100644 --- a/gui/src/pages/AddNewModel/configs/providers.ts +++ b/gui/src/pages/AddNewModel/configs/providers.ts @@ -352,6 +352,27 @@ Select the \`GPT-4o\` model below to complete your provider configuration, but n packages: [models.gemini15Pro, models.geminiPro, models.gemini15Flash], apiKeyUrl: "https://aistudio.google.com/app/apikey", }, + xAI: { + title: "xAI", + provider: "xAI", + icon: "xAI.png", + description: "xAI is a company working on building artificial intelligence to accelerate human scientific discovery", + longDescription: "To get started with xAI, obtain an API key from their [console](https://console.x.ai/).", + tags: [ModelProviderTags.RequiresApiKey, ModelProviderTags.OpenSource], + collectInputFor: [ + { + inputType: "text", + key: "apiKey", + label: "API Key", + placeholder: "Enter your xAI API key", + required: true, + }, + ], + packages: [ + models.grokBeta, + ], + apiKeyUrl: "https://console.x.ai/", + }, lmstudio: { title: "LM Studio", provider: "lmstudio", diff --git a/packages/llm-info/src/index.ts b/packages/llm-info/src/index.ts index 3c0ae9f34..84d88e031 100644 --- a/packages/llm-info/src/index.ts +++ b/packages/llm-info/src/index.ts @@ -8,6 +8,7 @@ import { Ollama } from "./providers/ollama.js"; import { OpenAi } from "./providers/openai.js"; import { Vllm } from "./providers/vllm.js"; import { Voyage } from "./providers/voyage.js"; +import { xAI } from "./providers/xAI.js"; import { LlmInfo, ModelProvider, UseCase } from "./types.js"; export const allModelProviders: ModelProvider[] = [ @@ -21,6 +22,7 @@ export const allModelProviders: ModelProvider[] = [ Vllm, Bedrock, Cohere, + xAI ]; export const allLlms: LlmInfo[] = allModelProviders.flatMap((provider) => diff --git a/packages/llm-info/src/providers/xAI.ts b/packages/llm-info/src/providers/xAI.ts new file mode 100644 index 000000000..81cc6ecf5 --- /dev/null +++ b/packages/llm-info/src/providers/xAI.ts @@ -0,0 +1,14 @@ +import { ModelProvider } from "../types.js"; + +export const xAI: ModelProvider = { + models: [ + { + model: "grok-beta", + displayName: "Grok Beta", + contextLength: 128000, + recommendedFor: ["chat"], + }, + ], + id: "xAI", + displayName: "xAI", +};