feat(providers): add DeepInfra preset - #747
Conversation
|
Warning Review limit reached
Next review available in: 28 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (15)
📝 WalkthroughWalkthroughThe PR adds DeepInfra as an OpenAI-compatible provider with API-key authentication, bounded live model discovery, slash-preserving routing, metadata support, registry parity, tests, and documentation in five languages. ChangesDeepInfra provider integration
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant ProviderRegistry
participant DeepInfraModels
participant DeepInfraInference
Client->>ProviderRegistry: select deepinfra and provide API key
ProviderRegistry->>DeepInfraModels: discover models with Bearer authentication
DeepInfraModels-->>ProviderRegistry: return bounded chat-tagged models
ProviderRegistry-->>Client: expose native model IDs and metadata
Client->>DeepInfraInference: send chat completion with selected model ID
DeepInfraInference-->>Client: return chat completion response
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
NEEDS-CHANGES + NEEDS-SECURITY-REVIEW (draft) The code is in good shape. What is missing is the evidence, not the implementation. The reason that list exists is that a canonical preset is where someone's API key gets sent. If a destination changes hands or its terms shift, we need to know who noticed and when. Both of these services aggregate third-party models, so the routing authorization item applies. If the evidence turns out to be hard to pin down, an inert reference row in What happens next: keep it in draft, add the missing primary-source evidence and a maintenance owner, then request security review. CI context (shared across the current review round). |
lidge-jun
left a comment
There was a problem hiding this comment.
Formalizing the disposition so it shows on your dashboard.
Blocking on the MAINTAINERS.md:35 evidence gate rather than the code — the presets and fixture tests are well built.
Missing: terms of service and operating legal entity, a named maintenance owner, and a citable verification date. Both DeepInfra and Novita aggregate third-party models, so routing authorization applies as well. The endpoint documentation you supplied is fine.
Worth knowing before you invest more: deepinfra and novita both already have inert rows in src/providers/free-directory.ts. When the evidence is incomplete, the same clause prefers a directory row over a canonical registry entry — so the fallback here is "leave them where they already are", not "drop the work".
Full per-item walkthrough in my earlier comment.
635721f to
0e30431
Compare
|
Addressed the canonical-preset evidence gate and rebased onto current
@lidge-jun, could you please re-review and perform the required security review? In particular, please confirm whether the cited DeepInfra Terms satisfy the aggregator-routing evidence gate; the PR body identifies that point explicitly for maintainer/security confirmation. @coderabbitai review |
0e30431 to
33c6cfe
Compare
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
REPO="lidge-jun/opencodex"
PR=747
echo "=== PR info ==="
gh pr view $PR --repo $REPO --json title,state,isDraft,baseRefName,headRefName,mergeable,additions,deletions,changedFiles
echo "=== Files changed ==="
gh pr diff $PR --repo $REPO --name-only
echo "=== registry.ts DeepInfra section ==="
gh pr diff $PR --repo $REPO -- src/providers/registry.ts | sed -n '1,400p'Length of output: 1770 🏁 Script executed: #!/bin/bash
set -euo pipefail
REPO="lidge-jun/opencodex"
PR=747
gh pr diff $PR --repo $REPO > /tmp/pr747.diff
wc -l /tmp/pr747.diff
echo "=== registry.ts diff ==="
awk '/^diff --git a\/src\/providers\/registry.ts/{flag=1} /^diff --git a\/(?!src\/providers\/registry.ts)/{if(flag && $0!~/registry.ts/) flag=0} flag' /tmp/pr747.diff | head -300
echo "=== extract via csplit-like approach ==="
python3 - <<'EOF'
import re
with open('/tmp/pr747.diff') as f:
content = f.read()
files = re.split(r'(?=^diff --git )', content, flags=re.M)
for f in files:
header = f.splitlines()[0] if f.splitlines() else ''
if 'registry.ts' in header or 'provider-fetch.ts' in header:
print(f)
print("=====END FILE=====")
EOFLength of output: 15386 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== filter type defs ==="
rg -n "containsAny|allOf" src/providers/registry.ts src/codex/catalog -g '*.ts' -C2 | head -100
echo "=== docs providers.md diff (English) ==="
python3 - <<'EOF'
import re
with open('/tmp/pr747.diff') as f:
content = f.read()
files = re.split(r'(?=^diff --git )', content, flags=re.M)
for f in files:
header = f.splitlines()[0] if f.splitlines() else ''
if 'docs-site/src/content/docs/guides/providers.md' in header:
print(f)
EOFLength of output: 4148
Registry entry — Context-window parsing — Fixture and tests. Registry parity — Docs. Scope check. On the open item I'll kick off a full review pass now. ✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs-site/src/content/docs/guides/providers.md`:
- Line 210: Update the DeepInfra entries in
docs-site/src/content/docs/guides/providers.md:210-210,
docs-site/src/content/docs/ja/guides/providers.md:136-136,
docs-site/src/content/docs/ko/guides/providers.md:136-136,
docs-site/src/content/docs/ru/guides/providers.md:146-146, and
docs-site/src/content/docs/zh-cn/guides/providers.md:128-128 to state that
DeepInfra is a key-based OpenAI Chat Completions provider using openai-chat and
a Bearer API key, translating the description for each locale. Do not imply
OAuth, passthrough, or a custom wire protocol.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 29898596-2816-4a88-abbf-f9d82071edc5
📒 Files selected for processing (15)
docs-site/src/content/docs/getting-started/quickstart.mddocs-site/src/content/docs/guides/providers.mddocs-site/src/content/docs/ja/getting-started/quickstart.mddocs-site/src/content/docs/ja/guides/providers.mddocs-site/src/content/docs/ko/getting-started/quickstart.mddocs-site/src/content/docs/ko/guides/providers.mddocs-site/src/content/docs/ru/getting-started/quickstart.mddocs-site/src/content/docs/ru/guides/providers.mddocs-site/src/content/docs/zh-cn/getting-started/quickstart.mddocs-site/src/content/docs/zh-cn/guides/providers.mdsrc/codex/catalog/provider-fetch.tssrc/providers/registry.tstests/deepinfra-provider.test.tstests/fixtures/deepinfra-models.jsontests/provider-registry-parity.test.ts
33c6cfe to
15a4336
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/deepinfra-provider.test.ts`:
- Around line 149-153: Update the assertions in the chat-model discovery test to
verify the second model’s parsed context window as well: assert contextWindow is
65_536 for the Qwen/Qwen2.5-VL-72B-Instruct entry, while preserving the existing
DeepSeek assertion and discovery checks.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: f6460bfa-b201-480c-9a3b-f6155d71a499
📒 Files selected for processing (15)
docs-site/src/content/docs/getting-started/quickstart.mddocs-site/src/content/docs/guides/providers.mddocs-site/src/content/docs/ja/getting-started/quickstart.mddocs-site/src/content/docs/ja/guides/providers.mddocs-site/src/content/docs/ko/getting-started/quickstart.mddocs-site/src/content/docs/ko/guides/providers.mddocs-site/src/content/docs/ru/getting-started/quickstart.mddocs-site/src/content/docs/ru/guides/providers.mddocs-site/src/content/docs/zh-cn/getting-started/quickstart.mddocs-site/src/content/docs/zh-cn/guides/providers.mdsrc/codex/catalog/provider-fetch.tssrc/providers/registry.tstests/deepinfra-provider.test.tstests/fixtures/deepinfra-models.jsontests/provider-registry-parity.test.ts
15a4336 to
75ac18d
Compare
|
Final follow-up after automated review and CI:
The remaining gate is the maintainer/security determination requested above for the cited third-party-model routing evidence, followed by re-review/dismissal of the earlier evidence-based changes request. |
Summary
deepinfraAPI-key preset, derived automatically into CLI init, key login, and dashboard provider surfacesGET https://api.deepinfra.com/v1/modelsendpoint and keep only rows whosemetadata.tagscontainchatmetadata.context_lengthNovita is intentionally no longer part of this canonical-preset PR. Its existing inert row in
src/providers/free-directory.tsremains available; it can be promoted separately if primary sources establish the operating legal entity and routing authorization required byMAINTAINERS.md.Safety and scope
https://api.deepinfra.com/v1/openai, and the authenticated discovery destination is fixed tohttps://api.deepinfra.com/v1/modelsconfig.jsonor the key-login projectionpreserveCustomDestinationkeeps an older same-named custom provider on its original host and adapter, including model discoverydevand relates to the provider-expansion umbrella in [Provider] Promote a verified batch of OpenAI-compatible inference providers #572Canonical-preset evidence
Verified on 2026-07-30:
/v1/openai, including chat completions.GET https://api.deepinfra.com/v1/modelswithAuthorization: Bearer <token>and a response containingmetadata.tagsandmetadata.context_length.Verification
bun run typecheckbun run privacy:scanbun test tests/deepinfra-provider.test.ts tests/provider-registry-parity.test.ts tests/provider-model-discovery-contract.test.ts tests/codex-catalog.test.ts— 169 pass, 0 failbun run test— 6273 pass, 4 skip, 0 fail across 457 filesbun run buildindocs-site/— 146 pages builtRelates to #572. This PR does not close the umbrella issue.
Summary by CodeRabbit