Skip to content

feat(providers): add Nscale and Vultr presets - #937

Merged
lidge-jun merged 1 commit into
lidge-jun:devfrom
olddonkey:codex/572-nscale-vultr-model-apis
Aug 6, 2026
Merged

feat(providers): add Nscale and Vultr presets#937
lidge-jun merged 1 commit into
lidge-jun:devfrom
olddonkey:codex/572-nscale-vultr-model-apis

Conversation

@olddonkey

@olddonkey olddonkey commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add first-class nscale and vultr API-key presets using their official OpenAI-compatible Chat Completions endpoints
  • discover models through authenticated /v1/models requests with 256 KiB / 256 raw-row ceilings and exact official tool-model allowlists
  • preserve same-named custom-provider destinations, retain provider-native model ids and flattened aliases, and keep unverified reasoning/parallel-tool claims disabled
  • add fixture-only routing, discovery, validation, metadata, derivation, and collision tests; sync provider counts and scope notes across all five documentation locales

Provider evidence and scope

Provider Official transport evidence Agent-capable model policy Contracting entity / routing evidence
Nscale Chat guide, models API, and chat completion API establish the first-party Bearer-authenticated endpoint. Nscale's catalog mixes chat, image, and embedding rows without a modality discriminator. Discovery admits only meta-llama/Llama-3.1-8B-Instruct, the exact model in the official tool-calling API example. Nscale's terms identify Nscale AS and expressly describe its on-demand public-cloud inference offering as using third-party models/products. Its AUP applies to customers and their respective end users, supporting customer-integrated routing subject to the AUP and incorporated model licenses.
Vultr Serverless Inference chat guide, tool-calling guide, and key retrieval establish the first-party Bearer-authenticated endpoint. Vultr states that tool calling is currently supported only by kimi-k2-instruct, so other catalog rows remain hidden. Vultr's pipeline-integration guidance explicitly tells customers to replace an existing inference base URL with Vultr's and use the subscription API key; the tool-calling guide covers applications and external API integrations. The service-wide Constant terms govern customer and end-user service use, while official billing instructions identify The Constant Company, LLC.

Both presets use Authorization: Bearer <key>, reject redirects during key validation, keep parallelToolCalls: false, and advertise no reasoning ladder until provider-specific tiers are documented. Maintenance owner: @olddonkey; no affiliation with either provider.

Verification date: 2026-08-03.

Sequencing

This PR remains Draft behind #870 and #872. It is currently based on standalone dev totals of 71 presets / 60 key presets; after those two batches land, a final restack will regenerate the sequential totals as 75 / 64.

Security boundary

This PR adds two canonical credential destinations, so explicit maintainer security review is requested. Vultr's publicly linked legal terms are service-wide rather than a Serverless-Inference-specific addendum, so the contracting/routing evidence is stated explicitly above for maintainer judgment. Registry-only discovery and collision policy is not persisted into config.json. Existing same-named custom providers retain their configured host and adapter, so a stored key cannot be silently redirected to either new endpoint.

Validation

  • bun run typecheck
  • bun test --isolate tests/nscale-vultr-provider.test.ts tests/provider-registry-parity.test.ts tests/provider-model-discovery-contract.test.ts — 58 pass, 0 fail
  • bun test --isolate tests — 7597 pass, 8 skip, 0 fail across 505 files
  • bun run privacy:scan
  • bun run build:gui
  • cd docs-site && bun run build
  • git diff --check

Relates to #572. This PR intentionally does not close the umbrella issue.

Review readiness checklist

This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:

  • All CI tests are green on my local testing.

  • I pushed my PR to the latest dev commit.

  • I resolved all correct Codex and CodeRabbit findings.

  • My PR is ready for review.

Summary by CodeRabbit

  • New Features

    • Added Nscale Serverless Inference and Vultr Serverless Inference as built-in provider presets.
    • Added authenticated model discovery with supported model filtering and tool-calling compatibility details.
    • Increased the built-in provider preset count from 74 to 76.
  • Documentation

    • Updated quickstart and provider guides across supported languages with the new provider details, endpoints, model availability, and setup information.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PR adds Nscale and Vultr serverless inference providers with bounded, allowlisted model discovery. It adds registry metadata, fixtures, provider tests, parity coverage, directory metadata, and localized documentation updates.

Changes

Serverless provider presets

Layer / File(s) Summary
Registry configuration
src/providers/registry.ts, src/providers/free-directory.ts
Adds Nscale and Vultr OpenAI-compatible provider entries with API endpoints, bearer authentication, seeded models, bounded discovery, and exact-model filters. Updates Nscale directory metadata.
Provider behavior validation
tests/nscale-vultr-provider.test.ts, tests/fixtures/*, tests/provider-registry-parity.test.ts
Adds fixtures and tests for registry metadata, preset derivation, authenticated discovery, filtering, routing, chat requests, custom-provider preservation, and registry parity.
Localized provider documentation
docs-site/src/content/docs/**/getting-started/quickstart.md, docs-site/src/content/docs/**/guides/providers.md
Updates preset counts and documents provider endpoints, credentials, discovery limits, native model IDs, and allowlisted models in English, Japanese, Korean, Russian, and Simplified Chinese.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant ProviderRegistry
  participant ModelDiscovery
  participant ProviderAPI
  Client->>ProviderRegistry: Select Nscale or Vultr preset
  ProviderRegistry->>ModelDiscovery: Apply provider discovery settings
  ModelDiscovery->>ProviderAPI: Send authenticated /v1/models request
  ProviderAPI-->>ModelDiscovery: Return provider model list
  ModelDiscovery-->>Client: Return bounded allowlisted models
Loading

Possibly related issues

Possibly related PRs

  • lidge-jun/opencodex#872 — Adds similar OpenAI-compatible serverless providers with bounded, allowlisted discovery and localized documentation.
  • lidge-jun/opencodex#870 — Uses the same registry, directory metadata, parity tests, fixtures, and provider discovery test pattern.
  • lidge-jun/opencodex#923 — Adds live-discovered provider presets with registry metadata, model filtering, documentation, fixtures, and provider tests.

Suggested reviewers: wibias, lidge-jun, ingwannu

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the main change: adding Nscale and Vultr provider presets.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the enhancement New feature or request label Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Author update — current head d717f77e

The canonical-preset evidence requested by the umbrella workflow is now explicit in the PR description:

  • Verification date is recorded.
  • Nscale's contracting entity, third-party-model terms, and customer/end-user AUP are linked.
  • Vultr's official existing-pipeline and tool-calling guidance is linked as routing authorization, together with The Constant Company, LLC evidence.
  • The description explicitly notes that Vultr's publicly linked terms are service-wide rather than a Serverless-Inference-specific addendum, leaving that judgment visible for maintainer security review.
  • There are currently no review threads.

The previously reported validation remains green: 58 focused tests, full suite 7597 pass / 8 skip / 0 fail, typecheck, privacy scan, GUI build, docs build, and git diff --check.

This PR remains Draft behind #870 and #872. After those batches land, I will perform the final restack and regenerate the sequential 75 / 64 provider totals. It relates to #572 and does not close the umbrella issue.

@Wibias

Wibias commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Please update to latest branch. Then i will review.

@lidge-jun
lidge-jun force-pushed the codex/572-nscale-vultr-model-apis branch from d717f77 to 5f44310 Compare August 6, 2026 10:36
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

⏳ DRAFT

  • review readiness checklist open (3/4 boxes ticked).

What to do

  • Tick all four boxes in the PR description once you're done (currently 3/4).

Review readiness checklist

  • ✅ All CI tests are green on my local testing.
  • ⬜ I pushed my PR to the latest dev commit.
  • ✅ I resolved all correct Codex and CodeRabbit findings.
  • ✅ My PR is ready for review.

3/4 boxes ticked.

Automatic draft conversion failed. Please convert this pull request to a draft manually until every box above is ticked.

@lidge-jun

Copy link
Copy Markdown
Owner

Maintainer rebase and merge preparation (2026-08-06)

Rebased onto current dev (e50f58057, the #872 merge) — this is the third and last batch of the stack, so it now sits on top of #870 and #872.

Conflicts

src/providers/registry.ts applied cleanly: this PR inserts after hyperbolic, ahead of the commandcode block that #870 and #872 grew. The parity array needed a manual union in registry order (hyperbolic, nscale, vultr, baseten, commandcode, sambanova, nebius, digitalocean, scaleway) because that assertion is an order-sensitive deep-equal; the order was read out of the file rather than assumed.

Ten documentation conflicts, and one of them is worth flagging: the mechanical merge silently dropped this PR's "Nscale and Vultr discovery" prose paragraph in all five locales. The table rows survived, so a quick skim looked fine — the omission only showed up when grepping for Nscale returned two hits (table only) instead of table plus prose. Each locale's paragraph was recovered from d717f77e7 and reinserted after the Hyperbolic paragraph. Flagging it because it is exactly the kind of loss that a green test suite never catches.

Totals regenerated from the executed registry

total 76 { forward: 1, oauth: 8, key: 64, local: 3 }

All count sites now read 76 = 64 key + 8 OAuth + 3 local + 1 forward. The PR body's predicted "75 / 64" was computed against a 71-preset base that no longer exists.

Verification on e50f58057

  • bun run typecheck — exit 0
  • bun test --isolate tests/nscale-vultr-provider.test.ts tests/provider-registry-parity.test.ts tests/provider-model-discovery-contract.test.ts tests/digitalocean-scaleway-provider.test.ts tests/sambanova-nebius-provider.test.ts82 pass, 0 fail
  • bun run privacy:scan — passed
  • git diff --check origin/dev...HEAD — clean

Security review (MAINTAINERS.md)

Reviewed as a credential-destination change. Both presets use Bearer transport on their documented hosts (https://inference.api.nscale.com/v1, https://api.vultrinference.com/v1), set preserveCustomDestination, keep parallelToolCalls: false, and carry their primary-source citations as code comments — the pattern the Volcengine work established, and the right one.

Each provider exposes exactly one model, and that restraint is the correct call rather than a limitation. Nscale's catalog mixes chat, image, and embedding rows with no modality discriminator, so only the model in its official tool-calling example is admitted; Vultr documents kimi-k2-instruct as its sole tool-calling model. For a coding agent, a model that cannot complete a tool loop is worse than a model that is not listed.

Planning record: devlog/_plan/260806_provider_preset_stack/030_wp3_pr937.md.

Thanks @olddonkey — three batches, consistent evidence discipline throughout. Umbrella #572 stays open.

@lidge-jun
lidge-jun marked this pull request as ready for review August 6, 2026 10:36
@github-actions
github-actions Bot marked this pull request as draft August 6, 2026 10:37

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 220: Update docs-site/src/content/docs/guides/providers.md lines 220-220
to describe the catalog as 64 key-based, 8 OAuth, 3 local, and 1 forward preset;
update docs-site/src/content/docs/zh-cn/guides/providers.md lines 135-135
similarly, replacing the default wording with the forward preset wording.
🪄 Autofix

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: d0b11cf6-bb13-4c46-ac5f-0728b8db85f3

📥 Commits

Reviewing files that changed from the base of the PR and between e50f580 and 5f44310.

📒 Files selected for processing (16)
  • docs-site/src/content/docs/getting-started/quickstart.md
  • docs-site/src/content/docs/guides/providers.md
  • docs-site/src/content/docs/ja/getting-started/quickstart.md
  • docs-site/src/content/docs/ja/guides/providers.md
  • docs-site/src/content/docs/ko/getting-started/quickstart.md
  • docs-site/src/content/docs/ko/guides/providers.md
  • docs-site/src/content/docs/ru/getting-started/quickstart.md
  • docs-site/src/content/docs/ru/guides/providers.md
  • docs-site/src/content/docs/zh-cn/getting-started/quickstart.md
  • docs-site/src/content/docs/zh-cn/guides/providers.md
  • src/providers/free-directory.ts
  • src/providers/registry.ts
  • tests/fixtures/nscale-models.json
  • tests/fixtures/vultr-models.json
  • tests/nscale-vultr-provider.test.ts
  • tests/provider-registry-parity.test.ts

## 3. API-key catalog

opencodex ships 74 built-in presets: 62 key-based, eight OAuth, three local, and one default
opencodex ships 76 built-in presets: 64 key-based, eight OAuth, three local, and one default

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use forward, not default, for the fourth preset category.

Both pages document the correct total but mislabel the fourth category. Replace the default-category wording with forward.

  • docs-site/src/content/docs/guides/providers.md#L220-L220: change one default to one forward.
  • docs-site/src/content/docs/zh-cn/guides/providers.md#L135-L135: change 1 个默认的 to the forward preset wording.

As per path instructions, document the catalog as 64 key, 8 OAuth, 3 local, and 1 forward preset.

📍 Affects 2 files
  • docs-site/src/content/docs/guides/providers.md#L220-L220 (this comment)
  • docs-site/src/content/docs/zh-cn/guides/providers.md#L135-L135
🤖 Prompt for 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.

In `@docs-site/src/content/docs/guides/providers.md` at line 220, Update
docs-site/src/content/docs/guides/providers.md lines 220-220 to describe the
catalog as 64 key-based, 8 OAuth, 3 local, and 1 forward preset; update
docs-site/src/content/docs/zh-cn/guides/providers.md lines 135-135 similarly,
replacing the default wording with the forward preset wording.

Source: Path instructions

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5f44310059

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/providers/registry.ts
authKind: "key",
dashboardUrl: "https://console.nscale.com",
defaultModel: "meta-llama/Llama-3.1-8B-Instruct",
models: ["meta-llama/Llama-3.1-8B-Instruct"],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Route the text-only presets through the vision sidecar

When a turn contains an image, both meta-llama/Llama-3.1-8B-Instruct and Vultr's kimi-k2-instruct are text-only, but neither new registry entry includes its model in noVisionModels. Because applyProviderConfigHints defaults these modality-less catalog rows to text-only and planVisionSidecar only activates for noVisionModels, Codex blocks attachments before the proxy can describe them, while clients that submit images directly send unsupported content upstream. Add both IDs to the registry classification and cover the sidecar/catalog behavior in the focused provider test.

AGENTS.md reference: src/AGENTS.md:L18-L18

Useful? React with 👍 / 👎.

@lidge-jun
lidge-jun marked this pull request as ready for review August 6, 2026 10:45
@github-actions
github-actions Bot marked this pull request as draft August 6, 2026 10:45
@lidge-jun

Copy link
Copy Markdown
Owner

Gate note: this PR does not change the gui, so no screenshot applies.

git diff --name-only origin/dev...HEAD on the rebased head 5f4431005 returns zero files under gui/ and no .tsx/.css files. The screenshot gate is matching the string bun run build:gui in the verification command list, which is a build command the author ran, not a UI change.

Verified before waiving.

@lidge-jun
lidge-jun marked this pull request as ready for review August 6, 2026 10:47
@github-actions
github-actions Bot marked this pull request as draft August 6, 2026 10:47
@lidge-jun
lidge-jun marked this pull request as ready for review August 6, 2026 10:48
@github-actions
github-actions Bot marked this pull request as draft August 6, 2026 10:48
@lidge-jun
lidge-jun marked this pull request as ready for review August 6, 2026 10:50
@github-actions
github-actions Bot marked this pull request as draft August 6, 2026 10:50
@lidge-jun
lidge-jun marked this pull request as ready for review August 6, 2026 10:51
@lidge-jun
lidge-jun merged commit 8ed03e7 into lidge-jun:dev Aug 6, 2026
25 of 32 checks passed
lidge-jun added a commit that referenced this pull request Aug 7, 2026
Roadmap unit for the four open provider-preset PRs under umbrella issue #572,
produced by a docs-only PABCD cycle and hardened through five rounds of
independent adversarial audit.

- 000_plan.md: dependency-ordered work-phase map (#870 -> #872 -> #937, then
  #812), measured ground truth (dev registry = 70 presets: 58 key, 8 oauth,
  3 local, 1 forward), the count-regeneration contract, and amendments A1-A8.
- 010/020/030: diff-level rebase, verification, and merge docs per PR.
- 040: the Apertis evidence gate and its resolved disposition.

Findings that changed the plan: the OAuth narrative in all five locales states
six-plus-Copilot while the registry has eight oauth rows including command-code
(pre-existing defect, folded into WP1); the measured #870 rebase conflicts only
in the ten locale docs while all code applies cleanly; deepinfra is
destination-fallback-eligible with an absolute discovery URL, so the invariant
is same-origin rather than same-URL; and #870's destination-fallback tests lack
negative cases, which WP1 now builds rather than confirms.

Refs #572, #870, #872, #937, #812.
lidge-jun added a commit that referenced this pull request Aug 7, 2026
Three PRs landed on dev: #870 (bbd82e7), #872 (e50f580), #937 (8ed03e7).
The registry went 70 -> 76 presets, measured by executing the module.

#812 (Apertis) is not merged and not closed. It meets four of the five canonical
preset requirements and fails exactly the aggregator resale/routing
authorization clause in MAINTAINERS.md. The prescribed free-directory fallback
does not apply either, because that directory only admits free-access groups.

Records what the process actually caught: the count contract stopped three real
regressions (a stale OAuth number in the incoming diff, a pre-existing wrong
OAuth narrative in five locales, and git rerere replaying a stale total), while
a dropped documentation paragraph in WP3 was invisible to every automated gate
and surfaced only from a grep.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants