Add Nebius provider
This commit is contained in:
parent
6ee0febabc
commit
9fc556c3ed
15 changed files with 148 additions and 21 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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(),
|
||||
|
|
|
|||
18
core/index.d.ts
vendored
18
core/index.d.ts
vendored
|
|
@ -48,9 +48,9 @@ export interface IndexingProgressUpdate {
|
|||
export type PromptTemplate =
|
||||
| string
|
||||
| ((
|
||||
history: ChatMessage[],
|
||||
otherData: Record<string, string>,
|
||||
) => string | ChatMessage[]);
|
||||
history: ChatMessage[],
|
||||
otherData: Record<string, string>,
|
||||
) => 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<TabAutocompleteOptions>;
|
||||
/** UI styles customization */
|
||||
|
|
|
|||
13
core/indexing/embeddings/NebiusEmbeddingsProvider.ts
Normal file
13
core/indexing/embeddings/NebiusEmbeddingsProvider.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import { EmbeddingsProviderName, EmbedOptions } from "../..";
|
||||
import OpenAIEmbeddingsProvider from "./OpenAIEmbeddingsProvider";
|
||||
|
||||
class NebiusEmbeddingsProvider extends OpenAIEmbeddingsProvider {
|
||||
static providerName: EmbeddingsProviderName = "nebius";
|
||||
|
||||
static defaultOptions: Partial<EmbedOptions> | undefined = {
|
||||
apiBase: "https://api.studio.nebius.ai/v1/",
|
||||
model: "BAAI/bge-en-icl",
|
||||
};
|
||||
}
|
||||
|
||||
export default NebiusEmbeddingsProvider;
|
||||
|
|
@ -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,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -124,6 +124,7 @@ const PARALLEL_PROVIDERS: ModelProvider[] = [
|
|||
"replicate",
|
||||
"together",
|
||||
"sambanova",
|
||||
"nebius",
|
||||
];
|
||||
|
||||
function llmCanGenerateInParallel(
|
||||
|
|
|
|||
12
core/llm/llms/Nebius.ts
Normal file
12
core/llm/llms/Nebius.ts
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import { LLMOptions, ModelProvider } from "../..";
|
||||
import OpenAI from "./OpenAI";
|
||||
|
||||
class Nebius extends OpenAI {
|
||||
static providerName: ModelProvider = "nvidia";
|
||||
static defaultOptions: Partial<LLMOptions> = {
|
||||
apiBase: "https://api.studio.nebius.ai/v1/",
|
||||
useLegacyCompletionsEndpoint: false,
|
||||
};
|
||||
}
|
||||
|
||||
export default Nebius;
|
||||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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": {
|
||||
|
|
|
|||
|
|
@ -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": {
|
||||
|
|
|
|||
|
|
@ -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": {
|
||||
|
|
|
|||
BIN
gui/public/logos/nebius.png
Normal file
BIN
gui/public/logos/nebius.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.6 KiB |
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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(),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue