diff --git a/core/control-plane/schema.ts b/core/control-plane/schema.ts index d29316d5e..34c391711 100644 --- a/core/control-plane/schema.ts +++ b/core/control-plane/schema.ts @@ -16,6 +16,7 @@ const modelDescriptionSchema = z.object({ "sagemaker", "cloudflare", "azure", + "ovhcloud", "nebius", "siliconflow", "scaleway", @@ -86,6 +87,7 @@ const embeddingsProviderSchema = z.object({ "cohere", "free-trial", "gemini", + "ovhcloud", "nebius", "siliconflow", "scaleway", diff --git a/core/indexing/allEmbeddingsProviders.ts b/core/indexing/allEmbeddingsProviders.ts index 3986fa2c0..41eb5fa6b 100644 --- a/core/indexing/allEmbeddingsProviders.ts +++ b/core/indexing/allEmbeddingsProviders.ts @@ -13,6 +13,7 @@ import Nebius from "../llm/llms/Nebius.js"; import Nvidia from "../llm/llms/Nvidia.js"; import Ollama from "../llm/llms/Ollama.js"; import OpenAI from "../llm/llms/OpenAI.js"; +import OVHcloud from "../llm/llms/OVHcloud.js"; import SageMaker from "../llm/llms/SageMaker.js"; import Scaleway from "../llm/llms/Scaleway.js"; import SiliconFlow from "../llm/llms/SiliconFlow.js"; @@ -42,6 +43,7 @@ export const allEmbeddingsProviders: Record< deepinfra: DeepInfra, ncompass: NCompass, nvidia: Nvidia, + ovhcloud: OVHcloud, voyage: Voyage, mistral: Mistral, nebius: Nebius, diff --git a/core/llm/autodetect.ts b/core/llm/autodetect.ts index 05c294f9d..2aa00a3b5 100644 --- a/core/llm/autodetect.ts +++ b/core/llm/autodetect.ts @@ -77,6 +77,7 @@ const PROVIDER_SUPPORTS_IMAGES: string[] = [ "azure", "scaleway", "nebius", + "ovhcloud" ]; const MODEL_SUPPORTS_IMAGES: string[] = [ @@ -147,6 +148,7 @@ const PARALLEL_PROVIDERS: string[] = [ "together", "novita", "sambanova", + "ovhcloud", "nebius", "vertexai", "function-network", @@ -380,5 +382,6 @@ export { autodetectTemplateType, llmCanGenerateInParallel, modelSupportsImages, - modelSupportsTools, + modelSupportsTools }; + diff --git a/core/llm/llms/OVHcloud.ts b/core/llm/llms/OVHcloud.ts new file mode 100644 index 000000000..d79b06b20 --- /dev/null +++ b/core/llm/llms/OVHcloud.ts @@ -0,0 +1,39 @@ +import { ChatCompletionCreateParams } from "openai/resources/index"; +import { ChatMessage, CompletionOptions, LLMOptions } from "../../index.js"; +import OpenAI from "./OpenAI.js"; + +export class OVHcloud extends OpenAI { + static providerName = "ovhcloud"; + + static defaultOptions: Partial = { + apiBase: "https://oai.endpoints.kepler.ai.cloud.ovh.net/v1/", + model: "Qwen2.5-Coder-32B-Instruct", + useLegacyCompletionsEndpoint: false, + }; + + private static MODEL_IDS: { [name: string]: string } = { + "llama3.1-8b": "Llama-3.1-8B-Instruct", + "llama3.1-70b": "Meta-Llama-3_1-70B-Instruct", + "llama3.3-70b": "Meta-Llama-3_3-70B-Instruct", + "qwen2.5-coder-32b": "Qwen2.5-Coder-32B-Instruct", + "codestral-mamba-latest": "mamba-codestral-7B-v0.1", + "mistral-7b": "Mistral-7B-Instruct-v0.3", + "mistral-8x7b": "Mixtral-8x7B-Instruct-v0.1", + "mistral-nemo": "Mistral-Nemo-Instruct-2407", + "DeepSeek-R1-Distill-Llama-70B": "DeepSeek-R1-Distill-Llama-70B" + }; + + protected _convertModelName(model: string) { + return OVHcloud.MODEL_IDS[model] || this.model; + } + + protected _convertArgs(options: CompletionOptions, messages: ChatMessage[]): ChatCompletionCreateParams { + const modifiedOptions = { + ...options, + model: this._convertModelName(options.model) + }; + return super._convertArgs(modifiedOptions, messages); + } +} + +export default OVHcloud; \ No newline at end of file diff --git a/core/llm/llms/index.ts b/core/llm/llms/index.ts index e6a33a9a8..11d38cc33 100644 --- a/core/llm/llms/index.ts +++ b/core/llm/llms/index.ts @@ -41,6 +41,7 @@ import Nvidia from "./Nvidia"; import Ollama from "./Ollama"; import OpenAI from "./OpenAI"; import OpenRouter from "./OpenRouter"; +import OVHcloud from "./OVHcloud"; import { Relace } from "./Relace"; import Replicate from "./Replicate"; import SageMaker from "./SageMaker"; @@ -74,6 +75,7 @@ export const LLMClasses = [ Kindo, LlamaCpp, OpenAI, + OVHcloud, LMStudio, Mistral, Bedrock, diff --git a/docs/docs/customize/model-providers/more/ovhcloud.mdx b/docs/docs/customize/model-providers/more/ovhcloud.mdx new file mode 100644 index 000000000..6dd4613b9 --- /dev/null +++ b/docs/docs/customize/model-providers/more/ovhcloud.mdx @@ -0,0 +1,72 @@ +--- +title: OVHcloud AI Endpoints +--- + +import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; + +OVHcloud AI Endpoints is a serverless inference API that provides access to a curated selection of models (e.g., Llama, Mistral, Qwen, Deepseek). It is designed with security and data privacy in mind and is compliant with GDPR. + +:::info +To get started, create an API key on the OVHcloud [AI Endpoints website](https://endpoints.ai.cloud.ovh.net/). For more information, including pricing, visit the OVHcloud [AI Endpoints product page](https://www.ovhcloud.com/en/public-cloud/ai-endpoints/). +::: + +## Chat model + +We recommend configuring **Qwen2.5-Coder-32B-Instruct** as your chat model. +Check our [catalog](https://endpoints.ai.cloud.ovh.net/catalog) to see all of our models hsoted on AI Endpoints. + + + + ```yaml title="config.yaml" + models: + - name: Qwen2.5-Coder-32B-Instruct + provider: ovhcloud + model: qwen2.5-coder-32b + apiKey: + ``` + + + ```json title="config.json" + { + "models": [ + { + "title": "Qwen2.5-Coder-32B-Instruct", + "provider": "ovhcloud", + "model": "qwen2.5-coder-32b", + "apiKey": "" + } + ] + } + ``` + + + +## Embeddings model + +We recommend configuring **bge-multilingual-gemma2** as your embeddings model. + + + + ```yaml title="config.yaml" + models: + - name: BGE Multilingual Gemma2 + provider: ovhcloud + model: bge-multilingual-gemma2 + apiKey: + roles: + - embed + ``` + + + ```json title="config.json" + { + "embeddingsProvider": { + "provider": "ovhcloud", + "model": "bge-multilingual-gemma2", + "apiKey": "" + } + } + ``` + + diff --git a/extensions/vscode/config_schema.json b/extensions/vscode/config_schema.json index b8ae1d407..5f9ba79d9 100644 --- a/extensions/vscode/config_schema.json +++ b/extensions/vscode/config_schema.json @@ -216,7 +216,8 @@ "siliconflow", "function-network", "scaleway", - "relace" + "relace", + "ovhcloud" ], "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)", @@ -263,7 +264,8 @@ "### SiliconFlow\nTo get started with SiliconFlow, obtain your API key from [SiliconCloud](https://cloud.siliconflow.cn/account/ak). SiliconCloud provides cost-effective GenAI services based on excellent open source basic models.\n> [Models](https://siliconflow.cn/zh-cn/models)", "### Function Network offers private, affordable user-owned AI\nTo get started with Function Network, obtain your API key from [Function Network](https://www.function.network/join-waitlist). Function Network provides a variety of models for chat, completion, and embeddings.", "### Scaleway\n Generative APIs are serverless endpoints for the most popular AI models.\nHosted in European data centers and priced competitively per million tokens used, models served by Scaleway are ideal for users requiring low latency, full data privacy, and 100% compliance with EU AI Act. To get access to the Scaleway Generative APIs, read the [Quickstart guide](https://www.scaleway.com/en/docs/ai-data/generative-apis/quickstart/) and get a [valid API key](https://www.scaleway.com/en/docs/identity-and-access-management/iam/how-to/create-api-keys/).", - "### Relace\n Relace provides a fast apply model. To get started, obtain an API key from [here](https://app.relace.ai/settings/api-keys)." + "### Relace\n Relace provides a fast apply model. To get started, obtain an API key from [here](https://app.relace.ai/settings/api-keys).", + "### OVHcloud AI Endpoints is a serverless inference API that provides access to a curated selection of models (e.g., Llama, Mistral, Qwen, Deepseek). It is designed with security and data privacy in mind and is compliant with GDPR. To get started, create an API key on the OVHcloud [AI Endpoints website](https://endpoints.ai.cloud.ovh.net/). For more information, including pricing, visit the OVHcloud [AI Endpoints product page](https://www.ovhcloud.com/en/public-cloud/ai-endpoints/)." ], "type": "string" }, @@ -498,7 +500,8 @@ "nebius", "xAI", "kindo", - "scaleway" + "scaleway", + "ovhcloud" ] } }, @@ -1377,6 +1380,42 @@ } } }, + { + "if": { + "properties": { + "provider": { + "enum": ["ovhcloud"] + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "model": { + "anyOf": [ + { + "enum": [ + "llama3.1-8b", + "llama3.1-70b", + "llama3.3-70b", + "qwen2.5-coder-32b", + "codestral-mamba-latest", + "mistral-7b", + "mistral-8x7b", + "mistral-nemo", + "DeepSeek-R1-Distill-Llama-70B" + ] + }, + { + "type": "string" + } + ], + "markdownDescription": "Select a pre-defined option, or find the exact model string from OVHcloud [AI Endpoints catalog](https://endpoints.ai.cloud.ovh.net/catalog).", + "x-intellij-html-description": "Select a pre-defined option, or find the exact model string from OVHcloud AI Endpoints catalog." + } + } + } + }, { "if": { "properties": { @@ -2765,7 +2804,8 @@ "lmstudio", "siliconflow", "function-network", - "scaleway" + "scaleway", + "ovhcloud" ] }, "model": { diff --git a/gui/public/logos/ovhcloud.png b/gui/public/logos/ovhcloud.png new file mode 100644 index 000000000..8ba409324 Binary files /dev/null and b/gui/public/logos/ovhcloud.png differ diff --git a/gui/src/pages/AddNewModel/configs/models.ts b/gui/src/pages/AddNewModel/configs/models.ts index fafdc53b7..0a29f75d6 100644 --- a/gui/src/pages/AddNewModel/configs/models.ts +++ b/gui/src/pages/AddNewModel/configs/models.ts @@ -174,6 +174,7 @@ export const models: { [key: string]: ModelPackage } = { "llama.cpp", "replicate", "cerebras", + "ovhcloud", "nebius", "scaleway", ], @@ -371,6 +372,7 @@ export const models: { [key: string]: ModelPackage } = { "ollama", "lmstudio", "together", + "ovhcloud", "llama.cpp", "replicate", "nebius", @@ -511,7 +513,7 @@ export const models: { [key: string]: ModelPackage } = { contextLength: 65536, }, icon: "meta.png", - providerOptions: [], + providerOptions: ["ovhcloud"], isOpenSource: false, }, llama3170bChat: { @@ -524,7 +526,7 @@ export const models: { [key: string]: ModelPackage } = { contextLength: 8192, }, icon: "meta.png", - providerOptions: ["groq", "scaleway", "nebius"], + providerOptions: ["groq", "ovhcloud", "scaleway", "nebius"], isOpenSource: false, }, llama31405bChat: { @@ -635,6 +637,7 @@ export const models: { [key: string]: ModelPackage } = { "ollama", "lmstudio", "together", + "ovhcloud", "llama.cpp", "replicate", "nebius", @@ -753,7 +756,7 @@ export const models: { [key: string]: ModelPackage } = { contextLength: 256_000, }, icon: "mistral.png", - providerOptions: ["mistral"], + providerOptions: ["ovhcloud", "mistral"], isOpenSource: true, }, mistral7b: { @@ -1400,7 +1403,7 @@ export const models: { [key: string]: ModelPackage } = { contextLength: 32_000, }, icon: "qwen.png", - providerOptions: ["scaleway", "nebius", "ncompass"], + providerOptions: ["scaleway", "nebius", "ovhcloud", "ncompass"], isOpenSource: true, }, grokBeta: { @@ -1688,7 +1691,7 @@ export const models: { [key: string]: ModelPackage } = { contextLength: 32_000, }, icon: "deepseek.png", - providerOptions: ["sambanova"], + providerOptions: ["ovhcloud", "sambanova"], isOpenSource: true, }, deepseekR1: { diff --git a/gui/src/pages/AddNewModel/configs/providers.ts b/gui/src/pages/AddNewModel/configs/providers.ts index 089ba74f9..e49bcfe41 100644 --- a/gui/src/pages/AddNewModel/configs/providers.ts +++ b/gui/src/pages/AddNewModel/configs/providers.ts @@ -161,6 +161,40 @@ export const providers: Partial> = { packages: [models.llama31Chat, models.deepseek], apiKeyUrl: "https://function.network/join-waitlist", }, + ovhcloud: { + title: "OVHcloud", + provider: "ovhcloud", + refPage: "ovhcloud", + description: + "OVHcloud AI Endpoints is a serverless inference API that provides access to a curated selection of models (e.g., Llama, Mistral, Qwen, Deepseek). It is designed with security and data privacy in mind and is compliant with GDPR.", + longDescription: `To get started, create an API key on the OVHcloud [AI Endpoints website](https://endpoints.ai.cloud.ovh.net/). For more information, including pricing, visit the OVHcloud [AI Endpoints product page](https://www.ovhcloud.com/en/public-cloud/ai-endpoints/).`, + params: { + apiKey: "", + }, + collectInputFor: [ + { + inputType: "text", + key: "apiKey", + label: "API key", + placeholder: "Enter your AI Endpoints API key", + required: true, + }, + ...completionParamsInputsConfigs, + ], + icon: "ovhcloud.png", + tags: [ModelProviderTags.RequiresApiKey, ModelProviderTags.OpenSource], + packages: [ + models.llama318bChat, + models.llama3170bChat, + models.llama3370bChat, + models.codestralMamba, + models.mistralOs, + models.mistralNemo, + models.Qwen25Coder32b, + models.deepseekR1DistillLlama70B, + ], + apiKeyUrl: "https://endpoints.ai.cloud.ovh.net/", + }, scaleway: { title: "Scaleway", provider: "scaleway", diff --git a/package-lock.json b/package-lock.json index 6a0a55705..cdfb21273 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,8 @@ "@typescript-eslint/parser": "^7.8.0", "eslint-plugin-import": "^2.29.1", "prettier": "^3.3.3", - "prettier-plugin-tailwindcss": "^0.6.8" + "prettier-plugin-tailwindcss": "^0.6.8", + "typescript": "^5.6.3" } }, "node_modules/@eslint-community/eslint-utils": { @@ -2976,7 +2977,6 @@ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", "dev": true, - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" diff --git a/packages/config-types/src/index.ts b/packages/config-types/src/index.ts index e60b8e79b..8bf6bd01e 100644 --- a/packages/config-types/src/index.ts +++ b/packages/config-types/src/index.ts @@ -55,6 +55,7 @@ export const modelDescriptionSchema = z.object({ "sagemaker", "cloudflare", "azure", + "ovhcloud", "continue-proxy", "nebius", "scaleway", @@ -109,6 +110,7 @@ export const embeddingsProviderSchema = z.object({ "cohere", "free-trial", "gemini", + "ovhcloud", "continue-proxy", "nebius", "scaleway", diff --git a/packages/openai-adapters/README.md b/packages/openai-adapters/README.md index b84b198e7..2f29fbf0d 100644 --- a/packages/openai-adapters/README.md +++ b/packages/openai-adapters/README.md @@ -52,6 +52,7 @@ They are concerned with: - [x] OpenRouter - [x] OpenAI - [ ] !Ollama +- [x] OVHCLoud - [ ] Replicate - [ ] SageMaker - [x] SambaNova diff --git a/packages/openai-adapters/src/index.ts b/packages/openai-adapters/src/index.ts index 05e43fc20..58b1c1fba 100644 --- a/packages/openai-adapters/src/index.ts +++ b/packages/openai-adapters/src/index.ts @@ -2,7 +2,6 @@ import dotenv from "dotenv"; import { z } from "zod"; import { AnthropicApi } from "./apis/Anthropic.js"; import { AzureOpenAIApi } from "./apis/AzureOpenAI.js"; -import { BaseLlmApi } from "./apis/base.js"; import { CohereApi } from "./apis/Cohere.js"; import { DeepSeekApi } from "./apis/DeepSeek.js"; import { GeminiApi } from "./apis/Gemini.js"; @@ -11,6 +10,7 @@ import { MockApi } from "./apis/Mock.js"; import { MoonshotApi } from "./apis/Moonshot.js"; import { OpenAIApi } from "./apis/OpenAI.js"; import { RelaceApi } from "./apis/Relace.js"; +import { BaseLlmApi } from "./apis/base.js"; import { LLMConfig, OpenAIConfigSchema } from "./types.js"; dotenv.config(); @@ -71,6 +71,8 @@ export function constructLlmApi(config: LLMConfig): BaseLlmApi | undefined { return openAICompatible("http://localhost:10000", config); case "nvidia": return openAICompatible("https://integrate.api.nvidia.com/v1/", config); + case "ovhcloud": + return openAICompatible("https://oai.endpoints.kepler.ai.cloud.ovh.net/v1/", config); case "scaleway": return openAICompatible("https://api.scaleway.ai/v1/", config); case "fireworks": @@ -106,9 +108,10 @@ export { type Completion, type CompletionCreateParams, type CompletionCreateParamsNonStreaming, - type CompletionCreateParamsStreaming, + type CompletionCreateParamsStreaming } from "openai/resources/index"; // export export type { BaseLlmApi } from "./apis/base.js"; export type { LLMConfig } from "./types.js"; + diff --git a/packages/openai-adapters/src/types.ts b/packages/openai-adapters/src/types.ts index 04f0b0c12..d0d5c3e6f 100644 --- a/packages/openai-adapters/src/types.ts +++ b/packages/openai-adapters/src/types.ts @@ -37,6 +37,7 @@ export const OpenAIConfigSchema = BasePlusConfig.extend({ z.literal("deepinfra"), z.literal("groq"), z.literal("nvidia"), + z.literal("ovhcloud"), z.literal("fireworks"), z.literal("together"), z.literal("novita"),