feat(providers): add DeepInfra as a built-in inference provider#1773
Closed
mmilutinovic371 wants to merge 1 commit into
Closed
feat(providers): add DeepInfra as a built-in inference provider#1773mmilutinovic371 wants to merge 1 commit into
mmilutinovic371 wants to merge 1 commit into
Conversation
- Add providers/deepinfra.yaml profile (category: inference, endpoint: api.deepinfra.com:443, credential: DEEPINFRA_API_KEY) - Register profile in BUILT_IN_PROFILE_YAMLS - Add ProviderDiscoverySpec for DEEPINFRA_API_KEY env-var discovery - Add DEEPINFRA_PROFILE to openshell-core inference profiles (base URL: https://api.deepinfra.com/v1/openai, Bearer auth, OpenAI-compatible protocols) - Fix build_backend_url to strip /v1 prefix from request path when the base URL contains /v1/ as an internal segment, not just when it ends with /v1; this prevents URL doubling for providers like DeepInfra whose base URL is already rooted under /v1/openai - Update providers-v2 and manage-providers docs with DeepInfra rows
|
All contributors have signed the DCO ✍️ ✅ |
|
Thank you for your interest in contributing to OpenShell, @mmilutinovic371. This project uses a vouch system for first-time contributors. Before submitting a pull request, you need to be vouched by a maintainer. To get vouched:
See CONTRIBUTING.md for details. |
Author
|
I have read the DCO document and I hereby sign the DCO. |
Author
|
recheck |
johntmyers
reviewed
Jun 12, 2026
Comment on lines
+1
to
+15
| // SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| use crate::ProviderDiscoverySpec; | ||
|
|
||
| pub const SPEC: ProviderDiscoverySpec = ProviderDiscoverySpec { | ||
| id: "deepinfra", | ||
| credential_env_vars: &["DEEPINFRA_API_KEY"], | ||
| }; | ||
|
|
||
| test_discovers_env_credential!( | ||
| discovers_deepinfra_env_credentials, | ||
| "DEEPINFRA_API_KEY", | ||
| "di-test123" | ||
| ); |
Collaborator
There was a problem hiding this comment.
Remove this, we will only support providers v2.
Collaborator
|
Please re-open the PR. Also please update the PR to only support Providers v2. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
DeepInfra is one of the top open source LLM providers and a perfect fit for agent frameworks with its low cost and high performance. This PR promotes it from a documented workaround to a core built-in provider in OpenShell.
deepinfraas a built-in inference provider alongsidenvidia,openai, andanthropicDEEPINFRA_API_KEYis now discovered automatically via--from-existingopenshell provider list-profilesshows DeepInfra in the INFERENCE sectionbuild_backend_urlto correctly strip/v1from request paths when the provider base URL contains/v1/as an internal path segment (e.g.https://api.deepinfra.com/v1/openai) — without this fix, requests were routed to.../v1/openai/v1/chat/completions(404) instead of.../v1/openai/chat/completionsRelated Issue
N/A
Changes
providers/deepinfra.yaml— new built-in profile (inference category,api.deepinfra.com:443, Bearer auth,DEEPINFRA_API_KEY)crates/openshell-core/src/inference.rs—DEEPINFRA_PROFILE, normalization,profile_forentries + testscrates/openshell-providers/src/providers/deepinfra.rs— discovery spec + env-var testcrates/openshell-providers/src/{lib,profiles,providers/mod}.rs— registration (alphabetical module order)crates/openshell-router/src/backend.rs— URL construction fix + testdocs/sandboxes/providers-v2.mdx,docs/sandboxes/manage-providers.mdx— DeepInfra rowsTesting
mise run pre-commitpasses (rust, helm, markdown, license;python:protois a pre-existing failure unrelated to this PR)openshell-core,openshell-providers,openshell-router(cargo test -p openshell-core -p openshell-providers -p openshell-router)openshell provider list-profilesshowsdeepinfrain INFERENCE sectionopenshell provider create --name di --type deepinfra --from-existingdiscoversDEEPINFRA_API_KEYopenshell inference set --provider di --model <model> --no-verifyconfigures routecurl https://inference.local/v1/chat/completionsfrom inside sandbox returns a valid completion from DeepInfraUnit test results
Includes
inference::tests::profile_for_deepinfra,providers::deepinfra::tests::discovers_deepinfra_env_credentials, andbackend::tests::build_backend_url_dedupes_v1_for_base_with_v1_subpath.Provider list-profiles
End-to-end inference from inside sandbox
Screenshots / Logs
Checklist
docs/sandboxes/providers-v2.mdx,docs/sandboxes/manage-providers.mdx)