Skip to content

feat: Add DeepInfra as an inference provider#1804

Merged
hanouticelina merged 12 commits into
huggingface:mainfrom
deepinfra:feat/deepinfra-provider
Feb 24, 2026
Merged

feat: Add DeepInfra as an inference provider#1804
hanouticelina merged 12 commits into
huggingface:mainfrom
deepinfra:feat/deepinfra-provider

Conversation

@Thachnh
Copy link
Copy Markdown
Contributor

@Thachnh Thachnh commented Oct 14, 2025

What’s in this PR

This PR adds DeepInfra as a new inference provider for conversational and text-generation tasks. The integration is via DeepInfra’s OpenAI-compatible API endpoints.

Test

pnpm --filter @huggingface/inference test "test/InferenceClient.spec.ts" -t "DeepInfra"

> @huggingface/inference@4.11.2 test /home/thach/huggingface/huggingface.js/packages/inference
> vitest run --config vitest.config.mts test/InferenceClient.spec.ts -t DeepInfra


 RUN  v0.34.6 /home/thach/huggingface/huggingface.js/packages/inference

 ✓ test/InferenceClient.spec.ts (128) 1042ms
   ✓ InferenceClient (128) 1042ms
     ↓ backward compatibility (1) [skipped]
       ↓ works with old HfInference name [skipped]
     ...
     ✓ DeepInfra (3) 1041ms
       ✓ chatCompletion 988ms
       ✓ chatCompletion stream
       ✓ textGeneration 1002ms
     ...

 Test Files  1 passed (1)
      Tests  3 passed | 125 skipped (128)
   Start at  22:16:13
   Duration  3.34s (transform 1.09s, setup 23ms, collect 975ms, tests 1.04s, environment 0ms, prepare 771ms)

What’s next

Follow-up PRs will expand DeepInfra support to additional tasks such as text-to-image and text-to-audio.

Copy link
Copy Markdown
Contributor

@hanouticelina hanouticelina left a comment

Choose a reason for hiding this comment

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

Thank you! I left a couple of comments but it should be quite easy to address :)

Comment thread packages/inference/src/providers/deepinfra.ts
Comment thread packages/inference/src/providers/deepinfra.ts
Comment thread packages/inference/src/providers/deepinfra.ts
Comment thread packages/inference/src/providers/deepinfra.ts
@SBrandeis SBrandeis added the inference-providers integration of a new or existing Inference Provider label Feb 10, 2026
Copy link
Copy Markdown
Contributor

@hanouticelina hanouticelina left a comment

Choose a reason for hiding this comment

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

Thanks @Thachnh for the iteration! let's add the header mentioned in this comment then we will be good to merge 🙌

Comment thread packages/inference/src/providers/deepinfra.ts
Co-authored-by: célina <hanouticelina@gmail.com>
@Thachnh
Copy link
Copy Markdown
Contributor Author

Thachnh commented Feb 19, 2026

Thanks @Thachnh for the iteration! let's add the header mentioned in this comment then we will be good to merge 🙌

@hanouticelina The suggestion has been applied. Please help us merge the PR. Thanks.

Comment thread packages/inference/src/types.ts
Copy link
Copy Markdown
Contributor

@hanouticelina hanouticelina left a comment

Choose a reason for hiding this comment

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

@Thachnh looks good! can you run pnpm format . in the inference package and push the changes? thank you!

@HuggingFaceDocBuilderDev
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.

@hanouticelina hanouticelina merged commit f50b1ef into huggingface:main Feb 24, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

inference-providers integration of a new or existing Inference Provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants