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/llm/autodetect.ts b/core/llm/autodetect.ts index 92bf71266..145cb1ac6 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[] = [ @@ -148,6 +149,7 @@ const PARALLEL_PROVIDERS: string[] = [ "together", "novita", "sambanova", + "ovhcloud", "nebius", "vertexai", "function-network", @@ -382,5 +384,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 c932b5db4..d04f02dfe 100644 --- a/core/llm/llms/index.ts +++ b/core/llm/llms/index.ts @@ -46,6 +46,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"; @@ -81,6 +82,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 9ad8b8cb2..f262c309c 100644 --- a/extensions/vscode/config_schema.json +++ b/extensions/vscode/config_schema.json @@ -227,6 +227,7 @@ "function-network", "scaleway", "relace", + "ovhcloud", "morph" ], "markdownEnumDescriptions": [ @@ -275,6 +276,7 @@ "### 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).", + "### 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/).", "### Morph\nMorph provides a fast apply model. To get started, obtain an API key from [here](https://morphllm.com/dashboard)." ], "type": "string" @@ -510,7 +512,8 @@ "nebius", "xAI", "kindo", - "scaleway" + "scaleway", + "ovhcloud" ] } }, @@ -1393,6 +1396,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": { @@ -2779,7 +2818,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 1bfb49f7e..9e284aaea 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: { @@ -1456,7 +1459,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: { @@ -1690,7 +1693,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 50f23ec73..5f0dc75b4 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/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 8cda78931..e9ac7501b 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"; @@ -12,6 +11,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(); @@ -74,6 +74,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": @@ -109,9 +111,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 93edcc99b..a5e8c4955 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"),