Visitar URL original
[Inference Providers] deepinfra: add feature-extraction support by ovuruska · Pull Request #4656 · huggingface/huggingface_hub · GitHub
Skip to content

[Inference Providers] deepinfra: add feature-extraction support - #4656

Merged
hanouticelina merged 1 commit into
huggingface:mainfrom
ovuruska:deepinfra-feature-extraction
Aug 17, 2026
Merged

hanouticelina merged 1 commit into
huggingface:mainfrom
ovuruska:deepinfra-feature-extraction

Conversation

@ovuruska

@ovuruska ovuruska commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

What

Adds feature-extraction support to the deepinfra inference provider.

Details

This is the Python counterpart of the huggingface.js change (companion PR).

Tests

Added TestDeepInfraProvider cases mirroring the TTS ones: URL, payload, model-not-overridable, and response parsing.

pytest tests/test_inference_providers.py -k "DeepInfra and feature_extraction"  # 4 passed

🤖 Generated with Claude Code


Note

Low Risk
Additive provider task support following existing patterns; no auth, routing, or core inference client changes.

Overview
Adds feature-extraction (embeddings) support for the DeepInfra inference provider.

New DeepInfraFeatureExtractionTask calls DeepInfra's OpenAI-compatible /v1/openai/embeddings endpoint and returns embedding vectors from the response. The mapped provider model is applied last in the payload so callers cannot override it, matching existing DeepInfra ASR/TTS behavior.

Registers the task under deepinfra and adds unit tests for URL, payload, model override protection, and response parsing.

Reviewed by Cursor Bugbot for commit 50e0c45. Bugbot is set up for automated code reviews on this repo. Configure here.

…support

Adds `feature-extraction` support to the **deepinfra** inference provider.

- New `DeepInfraFeatureExtractionTask(TaskProviderHelper)` in
  `src/huggingface_hub/inference/_providers/deepinfra.py`.
- Targets DeepInfra's OpenAI-compatible endpoint `POST /v1/openai/embeddings`
  and returns the list of embedding vectors.
- The mapped provider model (`provider_mapping_info.provider_id`) is applied
  last in the payload so caller parameters cannot override it (consistent with
  the deepinfra ASR/TTS integrations, huggingface#4382 / huggingface#4559).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@hanouticelina hanouticelina left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@hanouticelina
hanouticelina merged commit 2e6c67d into huggingface:main Aug 17, 2026
20 of 22 checks passed
@bot-ci-comment

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@codecov

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.09%. Comparing base (1daa48b) to head (50e0c45).
⚠️ Report is 595 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4656      +/-   ##
==========================================
+ Coverage   75.00%   76.09%   +1.09%     
==========================================
  Files         145      179      +34     
  Lines       13978    23401    +9423     
==========================================
+ Hits        10484    17807    +7323     
- Misses       3494     5594    +2100     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@huggingface-hub-bot

Copy link
Copy Markdown
Contributor

This PR has been shipped as part of the v1.28.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants