Merge pull request #5066 from Marlinski/ovhcloud/add-ai-endpoints-llms

Add OVHcloud AI Endpoints provider
This commit is contained in:
Nate Sesti 2025-04-29 12:58:56 -07:00 • committed by GitHub
commit f7f0fea350
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 212 additions and 10 deletions

View file

@ -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",

View file

@ -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
};

39
core/llm/llms/OVHcloud.ts Normal file
View file

@ -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<LLMOptions> = {
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;

View file

@ -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,

View file

@ -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.
<Tabs groupId="config-example">
<TabItem value="yaml" label="YAML">
```yaml title="config.yaml"
models:
- name: Qwen2.5-Coder-32B-Instruct
provider: ovhcloud
model: qwen2.5-coder-32b
apiKey: <YOUR_AIENDPOINTS_API_KEY>
```
</TabItem>
<TabItem value="json" label="JSON">
```json title="config.json"
{
"models": [
{
"title": "Qwen2.5-Coder-32B-Instruct",
"provider": "ovhcloud",
"model": "qwen2.5-coder-32b",
"apiKey": "<YOUR_AIENDPOINTS_API_KEY>"
}
]
}
```
</TabItem>
</Tabs>
## Embeddings model
We recommend configuring **bge-multilingual-gemma2** as your embeddings model.
<Tabs groupId="config-example">
<TabItem value="yaml" label="YAML">
```yaml title="config.yaml"
models:
- name: BGE Multilingual Gemma2
provider: ovhcloud
model: bge-multilingual-gemma2
apiKey: <YOUR_AIENDPOINTS_API_KEY>
roles:
- embed
```
</TabItem>
<TabItem value="json" label="JSON">
```json title="config.json"
{
"embeddingsProvider": {
"provider": "ovhcloud",
"model": "bge-multilingual-gemma2",
"apiKey": "<YOUR_AIENDPOINTS_API_KEY>"
}
}
```
</TabItem>
</Tabs>

View file

@ -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 <a href='https://endpoints.ai.cloud.ovh.net/catalog'>AI Endpoints catalog</a>."
}
}
}
},
{
"if": {
"properties": {
@ -2779,7 +2818,8 @@
"lmstudio",
"siliconflow",
"function-network",
"scaleway"
"scaleway",
"ovhcloud"
]
},
"model": {

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

View file

@ -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: {

View file

@ -161,6 +161,40 @@ export const providers: Partial<Record<string, ProviderInfo>> = {
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",

View file

@ -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",

View file

@ -52,6 +52,7 @@ They are concerned with:
- [x] OpenRouter
- [x] OpenAI
- [ ] !Ollama
- [x] OVHCLoud
- [ ] Replicate
- [ ] SageMaker
- [x] SambaNova

View file

@ -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";

View file

@ -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"),