-
Notifications
You must be signed in to change notification settings - Fork 862
Add OVHcloud AI Endpoints as an Inference Provder #3541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Wauplin
merged 6 commits into
huggingface:main
from
eliasto:add-ovhcloud-ai-endpoints-provider
Nov 14, 2025
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
3490a10
Add OVHcloud AI Endpoints provider
eliasto b9c7c08
Only add text-generation and conversational task from feedback
eliasto 9ff4047
Edit name of class and text-generation
eliasto f0d2faf
Remove text_generation capability
eliasto 2067f01
Merge branch 'main' into add-ovhcloud-ai-endpoints-provider
Wauplin 4777b1d
Apply style fixes
github-actions[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| from typing import Any, Optional, Union | ||
|
|
||
| from huggingface_hub.inference._common import RequestParameters, _as_dict | ||
| from huggingface_hub.inference._providers._common import BaseConversationalTask, BaseTextGenerationTask | ||
|
|
||
|
|
||
| _PROVIDER = "ovhcloud" | ||
| _BASE_URL = "https://oai.endpoints.kepler.ai.cloud.ovh.net" | ||
|
|
||
|
|
||
| class OVHcloudConversationalTask(BaseConversationalTask): | ||
| def __init__(self): | ||
| super().__init__(provider=_PROVIDER, base_url=_BASE_URL) | ||
|
|
||
|
|
||
| class OVHcloudTextGenerationTask(BaseTextGenerationTask): | ||
| def __init__(self): | ||
| super().__init__(provider=_PROVIDER, base_url=_BASE_URL) | ||
|
|
||
| def get_response(self, response: Union[bytes, dict], request_params: Optional[RequestParameters] = None) -> Any: | ||
| output = _as_dict(response)["choices"][0] | ||
| return { | ||
| "generated_text": output["text"], | ||
| "details": { | ||
| "finish_reason": output.get("finish_reason"), | ||
| "seed": output.get("seed"), | ||
| }, | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In practice, do you have an example of
text-generation-only model that is deployed on OVH-side?Asking because most (if not all) users are interested in conversational models, i.e. on the Chat Completion and Responses APIs. The
text-generationtask is only useful for models generating text but not using a chat template e.g. gpt2-like models. It is not possible to register a model both as "conversational" and as "text-generation".There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at https://huggingface.co/api/partners/ovhcloud/models, it looks like only conversational models have been registered. If that's the plan, I would suggest to get rid of the
OVHcloudTextGenerationTaskclass entirely. Makes everything cleaner and more aligned with most other providers.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You right, we only have conversational models. I removed the text generation capability! 😄