diff --git a/core/config/types.ts b/core/config/types.ts index 0caf0e12e..48b859a43 100644 --- a/core/config/types.ts +++ b/core/config/types.ts @@ -598,7 +598,8 @@ declare global { | "watsonx" | "openrouter" | "sambanova" - | "nvidia"; + | "nvidia" + | "nebius"; export type ModelName = | "AUTODETECT" @@ -765,7 +766,8 @@ declare global { | "continue-proxy" | "deepinfra" | "voyage" - | "watsonx"; + | "watsonx" + | "nebius"; export interface EmbedOptions { apiBase?: string; diff --git a/core/control-plane/schema.ts b/core/control-plane/schema.ts index 756798937..2cefe9592 100644 --- a/core/control-plane/schema.ts +++ b/core/control-plane/schema.ts @@ -16,6 +16,7 @@ const modelDescriptionSchema = z.object({ "sagemaker", "cloudflare", "azure", + "nebius", ]), model: z.string(), apiKey: z.string().optional(), @@ -81,6 +82,7 @@ const embeddingsProviderSchema = z.object({ "cohere", "free-trial", "gemini", + "nebius", ]), apiBase: z.string().optional(), apiKey: z.string().optional(), diff --git a/core/index.d.ts b/core/index.d.ts index 2cc9dc56a..e72482a7b 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; @@ -647,7 +647,8 @@ type ModelProvider = | "vllm" | "mock" | "cerebras" - | "askSage"; + | "askSage" + | "nebius"; export type ModelName = | "AUTODETECT" @@ -830,7 +831,8 @@ export type EmbeddingsProviderName = | "voyage" | "mistral" | "vertex" - | "watsonx"; + | "watsonx" + | "nebius"; export interface EmbedOptions { apiBase?: string; @@ -1053,9 +1055,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/indexing/embeddings/NebiusEmbeddingsProvider.ts b/core/indexing/embeddings/NebiusEmbeddingsProvider.ts new file mode 100644 index 000000000..4bf20e868 --- /dev/null +++ b/core/indexing/embeddings/NebiusEmbeddingsProvider.ts @@ -0,0 +1,13 @@ +import { EmbeddingsProviderName, EmbedOptions } from "../.."; +import OpenAIEmbeddingsProvider from "./OpenAIEmbeddingsProvider"; + +class NebiusEmbeddingsProvider extends OpenAIEmbeddingsProvider { + static providerName: EmbeddingsProviderName = "nebius"; + + static defaultOptions: Partial | undefined = { + apiBase: "https://api.studio.nebius.ai/v1/", + model: "BAAI/bge-en-icl", + }; +} + +export default NebiusEmbeddingsProvider; diff --git a/core/indexing/embeddings/index.ts b/core/indexing/embeddings/index.ts index 64fa6bf48..a7931287e 100644 --- a/core/indexing/embeddings/index.ts +++ b/core/indexing/embeddings/index.ts @@ -16,6 +16,7 @@ import NvidiaEmbeddingsProvider from "./NvidiaEmbeddingsProvider.js"; import VoyageEmbeddingsProvider from "./VoyageEmbeddingsProvider.js"; import VertexEmbeddingsProvider from "./VertexEmbeddingsProvider.js"; import WatsonxEmbeddingsProvider from "./WatsonxEmbeddingsProvider.js"; +import NebiusEmbeddingsProvider from "./NebiusEmbeddingsProvider.js"; type EmbeddingsProviderConstructor = new ( ...args: any[] @@ -41,4 +42,5 @@ export const allEmbeddingsProviders: Record< mistral: MistralEmbeddingsProvider, vertex: VertexEmbeddingsProvider, watsonx: WatsonxEmbeddingsProvider, + nebius: NebiusEmbeddingsProvider, }; diff --git a/core/llm/autodetect.ts b/core/llm/autodetect.ts index 18464f155..1e3207c21 100644 --- a/core/llm/autodetect.ts +++ b/core/llm/autodetect.ts @@ -124,6 +124,7 @@ const PARALLEL_PROVIDERS: ModelProvider[] = [ "replicate", "together", "sambanova", + "nebius", ]; function llmCanGenerateInParallel( diff --git a/core/llm/llms/Nebius.ts b/core/llm/llms/Nebius.ts new file mode 100644 index 000000000..4e2b56721 --- /dev/null +++ b/core/llm/llms/Nebius.ts @@ -0,0 +1,12 @@ +import { LLMOptions, ModelProvider } from "../.."; +import OpenAI from "./OpenAI"; + +class Nebius extends OpenAI { + static providerName: ModelProvider = "nvidia"; + static defaultOptions: Partial = { + apiBase: "https://api.studio.nebius.ai/v1/", + useLegacyCompletionsEndpoint: false, + }; +} + +export default Nebius; diff --git a/core/llm/llms/index.ts b/core/llm/llms/index.ts index 27e1a31b9..0c1a465b0 100644 --- a/core/llm/llms/index.ts +++ b/core/llm/llms/index.ts @@ -33,6 +33,7 @@ import Mistral from "./Mistral"; import MistralVertexAI from "./MistralVertexAI"; import Mock from "./Mock"; import Msty from "./Msty"; +import Nebius from "./Nebius"; import Nvidia from "./Nvidia"; import Ollama from "./Ollama"; import OpenAI from "./OpenAI"; @@ -87,6 +88,7 @@ const LLMs = [ Mock, Cerebras, Asksage, + Nebius, ]; export async function llmFromDescription( diff --git a/extensions/intellij/src/main/resources/config_schema.json b/extensions/intellij/src/main/resources/config_schema.json index 173292611..31c341961 100644 --- a/extensions/intellij/src/main/resources/config_schema.json +++ b/extensions/intellij/src/main/resources/config_schema.json @@ -199,7 +199,8 @@ "nvidia", "vllm", "cerebras", - "askSage" + "askSage", + "nebius" ], "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)", @@ -459,7 +460,8 @@ "replicate", "together", "cloudflare", - "sambanova" + "sambanova", + "nebius" ] } }, @@ -2479,7 +2481,8 @@ "nvidia", "bedrock", "sagemaker", - "vertex" + "vertex", + "nebius" ] }, "model": { diff --git a/extensions/vscode/config_schema.json b/extensions/vscode/config_schema.json index 173292611..31c341961 100644 --- a/extensions/vscode/config_schema.json +++ b/extensions/vscode/config_schema.json @@ -199,7 +199,8 @@ "nvidia", "vllm", "cerebras", - "askSage" + "askSage", + "nebius" ], "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)", @@ -459,7 +460,8 @@ "replicate", "together", "cloudflare", - "sambanova" + "sambanova", + "nebius" ] } }, @@ -2479,7 +2481,8 @@ "nvidia", "bedrock", "sagemaker", - "vertex" + "vertex", + "nebius" ] }, "model": { diff --git a/extensions/vscode/continue_rc_schema.json b/extensions/vscode/continue_rc_schema.json index 1c1610446..6f7a41730 100644 --- a/extensions/vscode/continue_rc_schema.json +++ b/extensions/vscode/continue_rc_schema.json @@ -202,7 +202,8 @@ "nvidia", "vllm", "cerebras", - "askSage" + "askSage", + "nebius" ], "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)", @@ -471,7 +472,8 @@ "replicate", "together", "cloudflare", - "sambanova" + "sambanova", + "nebius" ] } }, @@ -2784,7 +2786,8 @@ "nvidia", "bedrock", "sagemaker", - "vertex" + "vertex", + "nebius" ] }, "model": { diff --git a/gui/public/logos/nebius.png b/gui/public/logos/nebius.png new file mode 100644 index 000000000..05510a7ef Binary files /dev/null and b/gui/public/logos/nebius.png differ diff --git a/gui/src/pages/AddNewModel/configs/models.ts b/gui/src/pages/AddNewModel/configs/models.ts index 64d489d2b..b4ebbf3df 100644 --- a/gui/src/pages/AddNewModel/configs/models.ts +++ b/gui/src/pages/AddNewModel/configs/models.ts @@ -200,6 +200,7 @@ export const models: { [key: string]: ModelPackage } = { "together", "llama.cpp", "replicate", + "nebius", ], isOpenSource: true, }, @@ -438,6 +439,7 @@ export const models: { [key: string]: ModelPackage } = { "together", "llama.cpp", "replicate", + "nebius", ], isOpenSource: true, }, @@ -919,7 +921,7 @@ export const models: { [key: string]: ModelPackage } = { systemMessage: "You are an expert software developer. You give helpful and concise responses.", // Need to set this on the Ask Sage side or just configure it in here to be discussed }, - providerOptions: ["askSage"], + providerOptions: ["askSage"], icon: "openai.png", isOpenSource: false, }, @@ -934,10 +936,64 @@ export const models: { [key: string]: ModelPackage } = { systemMessage: "You are an expert software developer. You give helpful and concise responses.", // Need to set this on the Ask Sage side or just configure it in here to be discussed }, - providerOptions: ["askSage"], + providerOptions: ["askSage"], icon: "openai.png", isOpenSource: false, }, + MetaLlama3Large: { + title: "Llama 3.1 405b", + description: + "Llama 3 is an auto-regressive language model that uses an optimized transformer architecture.", + params: { + title: "Llama 3.1 405b", + model: "meta-llama/Meta-Llama-3.1-405B-Instruct", + contextLength: 128_000, + }, + icon: "meta.png", + dimensions: [ + { + name: "Parameter Count", + description: "The number of parameters in the model", + options: { + "70b": { + model: "meta-llama/Meta-Llama-3.1-70B-Instruct", + title: "Llama 3.1 70b", + }, + "405bb": { + model: "meta-llama/Meta-Llama-3.1-405B-Instruct", + title: "Llama 3.1 405b", + }, + }, + }, + ], + providerOptions: ["nebius"], + isOpenSource: true, + }, + Qwen2Coder: { + title: "Qwen 2.5 Coder 7b", + description: + "Qwen 2.5 is an auto-regressive language model that uses an optimized transformer architecture.", + params: { + title: "Qwen 2.5 Coder 7b", + model: "Qwen/Qwen2.5-Coder-7B-Instruct", + contextLength: 32_000, + }, + icon: "meta.png", + dimensions: [ + { + name: "Parameter Count", + description: "The number of parameters in the model", + options: { + "7b": { + model: "Qwen/Qwen2.5-Coder-7B-Instruct", + title: "Qwen 2.5 Coder 7b", + }, + }, + }, + ], + providerOptions: ["nebius"], + isOpenSource: true, + }, AUTODETECT: { title: "Autodetect", description: diff --git a/gui/src/pages/AddNewModel/configs/providers.ts b/gui/src/pages/AddNewModel/configs/providers.ts index e8ca87d53..855b48274 100644 --- a/gui/src/pages/AddNewModel/configs/providers.ts +++ b/gui/src/pages/AddNewModel/configs/providers.ts @@ -668,4 +668,28 @@ To get started, [register](https://dataplatform.cloud.ibm.com/registration/stepo ], apiKeyUrl: "https://chat.asksage.ai/", }, + nebius: { + title: "Nebius AI Studio", + provider: "nebius", + refPage: "nebiusllm", + description: "Use the Nebius API to run open-source models", + longDescription: `Nebius AI Studio is a cheap hosted service with $100 trial. To get started with Nebius AI Studio:\n1. Obtain an API key from [here](https://studio.nebius.ai)\n2. Paste below\n3. Select a model preset`, + params: { + apiKey: "", + }, + collectInputFor: [ + { + inputType: "text", + key: "apiKey", + label: "API Key", + placeholder: "Enter your Nebius AI Studio API key", + required: true, + }, + ...completionParamsInputsConfigs, + ], + icon: "nebius.png", + tags: [ModelProviderTags.RequiresApiKey, ModelProviderTags.OpenSource], + packages: [models.MetaLlama3Large, models.Qwen2Coder], + apiKeyUrl: "https://studio.nebius.ai/settings/api-keys", + }, }; diff --git a/packages/config-types/src/index.ts b/packages/config-types/src/index.ts index ee5699996..4a4b6e6e3 100644 --- a/packages/config-types/src/index.ts +++ b/packages/config-types/src/index.ts @@ -55,6 +55,7 @@ export const modelDescriptionSchema = z.object({ "cloudflare", "azure", "continue-proxy", + "nebius", ]), model: z.string(), apiKey: z.string().optional(), @@ -106,6 +107,7 @@ export const embeddingsProviderSchema = z.object({ "free-trial", "gemini", "continue-proxy", + "nebius", ]), apiBase: z.string().optional(), apiKey: z.string().optional(),