Skip to content

feat(providers): add SambaNova and Nebius presets - #870

Open
olddonkey wants to merge 1 commit into
lidge-jun:devfrom
olddonkey:codex/572-sambanova-nebius-model-apis
Open

feat(providers): add SambaNova and Nebius presets#870
olddonkey wants to merge 1 commit into
lidge-jun:devfrom
olddonkey:codex/572-sambanova-nebius-model-apis

Conversation

@olddonkey

@olddonkey olddonkey commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add canonical key presets for SambaNova Cloud and Nebius Token Factory, the next same-shape batch under umbrella issue [Provider] Promote a verified batch of OpenAI-compatible inference providers #572.
  • Pin registry-owned model discovery to each provider's first-party HTTPS API host while preserving an older same-named custom provider's destination and adapter.
  • Keep discovery bounded and fixture-tested:
    • SambaNova: GET https://api.sambanova.ai/v1/models, 128 KiB / 128 raw rows.
    • Nebius: authenticated GET https://api.tokenfactory.nebius.com/v1/models?verbose=true, 512 KiB / 512 raw rows, retaining only architecture.modality values that produce text.
  • Preserve native slash-containing ids and consume Nebius context-window, feature, and safe input-modality metadata.
  • Update the provider directory and all five documentation locales; registry totals are now 68 presets / 57 key presets.

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

Canonical preset evidence

Provider Evidence
SambaNova Cloud First-party API host and Bearer-key setup: API keys and URLs; OpenAI compatibility; function calling. The service terms identify SambaNova Systems, Inc. and permit customer/authorized-user service use while excluding resale: SambaCloud agreement.
Nebius Token Factory First-party Bearer-key quickstart and authenticated verbose catalog: quickstart, models.list, function calling. The terms identify Nebius B.V. and expressly permit incorporating the service into a Customer Product for End Users: terms.

Maintenance owner: @olddonkey. No affiliation with either provider.

SambaNova's models catalog is currently public: the key-login probe verifies the canonical endpoint/catalog is reachable, but that public response alone cannot prove a supplied key is valid. Chat requests still authenticate with the configured Bearer key.

Security and compatibility

  • These presets create new credential destinations, so explicit maintainer security review is requested.
  • Discovery policy stays registry-only and is not copied into config.json or the key-login map.
  • preserveCustomDestination prevents an existing same-named custom provider from silently sending its stored key to a newly canonical host.
  • Existing redirect denial and bounded-before-parse discovery behavior are retained.
  • Shared text-generation APIs only; private SambaStudio and dedicated Nebius deployment hosts are out of scope.
  • Parallel tool calls are conservatively disabled: SambaNova documents them as unsupported, while Nebius's public tools contract does not establish parallel execution.

Verification

  • bun run typecheck
  • bun test tests/sambanova-nebius-provider.test.ts tests/provider-model-discovery-contract.test.ts tests/provider-registry-parity.test.ts
  • bun run test — 6874 pass, 8 skip, 0 fail
  • bun run privacy:scan
  • cd docs-site && bun run build
  • git diff --check

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs were updated in English, Japanese, Korean, Russian, and Simplified Chinese.
  • Security-sensitive behavior was author-reviewed for secrets, auth, redirects, and unsafe destination changes.
  • Explicit maintainer security sign-off (required by MAINTAINERS.md).

Summary by CodeRabbit

  • New Features

    • Added SambaNova Cloud and Nebius Token Factory as built-in provider presets.
    • Provider setup now includes 68 presets, with live model discovery, filtering, authentication, and custom destination support.
    • Improved detection of text, image, and audio inputs from model metadata.
  • Documentation

    • Updated quickstart and provider guides in English, Japanese, Korean, Russian, and Simplified Chinese.
    • Documented provider capabilities, model limits, supported endpoints, authentication, and model discovery behavior.

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

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Added SambaNova Cloud and Nebius Token Factory provider presets with live model discovery, filtering, routing, authentication, modality handling, tests, and localized documentation.

Changes

Provider support

Layer / File(s) Summary
Architecture modality inference
src/codex/catalog/provider-fetch.ts, tests/provider-model-discovery-contract.test.ts
Discovery parses input modalities from architecture.modality values and rejects unsupported or unsafe metadata.
Provider registry and directory wiring
src/providers/registry.ts, src/providers/free-directory.ts, tests/provider-registry-parity.test.ts
Added SambaNova Cloud and Nebius Token Factory presets with bounded discovery, authentication, routing, metadata, and disabled parallel tool calls.
Provider routing and discovery validation
tests/fixtures/*.json, tests/sambanova-nebius-provider.test.ts
Added fixture-backed coverage for model discovery, filtering, metadata, endpoint authentication, routing, initialization, tool settings, and custom-provider preservation.
Provider catalog documentation
docs-site/src/content/docs/**
Updated preset counts and documented both providers across English, Japanese, Korean, Russian, and Simplified Chinese locales.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related issues

Possibly related PRs

Suggested reviewers: ingwannu, lidge-jun, wibias

🚥 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
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 SambaNova and Nebius provider presets.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

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

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`:
- Around line 263-267: Use the canonical provider name “SambaNova Cloud” in the
discovery paragraphs at docs-site/src/content/docs/guides/providers.md:263-267,
docs-site/src/content/docs/ja/guides/providers.md:186-190,
docs-site/src/content/docs/ko/guides/providers.md:185-188,
docs-site/src/content/docs/ru/guides/providers.md:195-199, and
docs-site/src/content/docs/zh-cn/guides/providers.md:174-177, replacing
“SambaCloud” while preserving the surrounding content.
🪄 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: 166f3977-fc25-44f9-a43f-bacb1df2498e

📥 Commits

Reviewing files that changed from the base of the PR and between 6edec46 and 42d08ac.

📒 Files selected for processing (18)
  • 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/codex/catalog/provider-fetch.ts
  • src/providers/free-directory.ts
  • src/providers/registry.ts
  • tests/fixtures/nebius-models.json
  • tests/fixtures/sambanova-models.json
  • tests/provider-model-discovery-contract.test.ts
  • tests/provider-registry-parity.test.ts
  • tests/sambanova-nebius-provider.test.ts

Comment on lines +263 to +267
**SambaNova discovery.** The preset reads SambaCloud's public `/v1/models` list from the fixed API
host, preserves provider-native ids, and caps discovery at 128 KiB and 128 raw rows. Chat requests
use the configured Bearer key and disable parallel function calls, which SambaNova does not yet
support. Private SambaStudio deployment endpoints are out of scope. Create keys in
[SambaCloud](https://cloud.sambanova.ai/apis).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Use one canonical name for the SambaNova provider.

The registry and provider tables use SambaNova Cloud, but each discovery paragraph uses SambaCloud. This inconsistency can make the discovery text appear to describe a different provider.

  • docs-site/src/content/docs/guides/providers.md#L263-L267: use SambaNova Cloud in the English discovery paragraph.
  • docs-site/src/content/docs/ja/guides/providers.md#L186-L190: use SambaNova Cloud in the Japanese discovery paragraph.
  • docs-site/src/content/docs/ko/guides/providers.md#L185-L188: use SambaNova Cloud in the Korean discovery paragraph.
  • docs-site/src/content/docs/ru/guides/providers.md#L195-L199: use SambaNova Cloud in the Russian discovery paragraph.
  • docs-site/src/content/docs/zh-cn/guides/providers.md#L174-L177: use SambaNova Cloud in the Chinese discovery paragraph.
📍 Affects 5 files
  • docs-site/src/content/docs/guides/providers.md#L263-L267 (this comment)
  • docs-site/src/content/docs/ja/guides/providers.md#L186-L190
  • docs-site/src/content/docs/ko/guides/providers.md#L185-L188
  • docs-site/src/content/docs/ru/guides/providers.md#L195-L199
  • docs-site/src/content/docs/zh-cn/guides/providers.md#L174-L177
🤖 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` around lines 263 - 267, Use
the canonical provider name “SambaNova Cloud” in the discovery paragraphs at
docs-site/src/content/docs/guides/providers.md:263-267,
docs-site/src/content/docs/ja/guides/providers.md:186-190,
docs-site/src/content/docs/ko/guides/providers.md:185-188,
docs-site/src/content/docs/ru/guides/providers.md:195-199, and
docs-site/src/content/docs/zh-cn/guides/providers.md:174-177, replacing
“SambaCloud” while preserving the surrounding content.

Sources: Path instructions, Linters/SAST tools

@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: 42d08ac5a0

ℹ️ 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
Comment on lines +1059 to +1060
modelDiscovery: {
path: "models",

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 Do not mark public SambaNova probes as valid keys

Because SambaNova's /v1/models endpoint is public, this discovery path returns HTTP 200 even when the supplied Bearer key is invalid. validateApiKey treats every successful models response as true, so ocx login sambanova prints valid and persists typoed or revoked keys, which only fail later on the first chat request. Special-case this public catalog to return "unknown", or validate against an endpoint that actually authenticates the key.

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

Useful? React with 👍 / 👎.

Comment thread src/providers/registry.ts
preserveCustomDestination: true,
// The public tools guide documents single function selection, not parallel tool calls.
parallelToolCalls: false,
modelDiscovery: {

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 Disable unverified reasoning controls for live models

When either new live catalog returns a row without reasoning metadata—as the committed Llama and Qwen fixtures do—catalogHintsFromModelsApiItem leaves reasoningEfforts undefined. applyReasoningLevels interprets that as the full Codex ladder with a medium default, and mapReasoningEffort consequently sends reasoning_effort to these non-reasoning models; this advertises a control the upstream catalog never reported and can make strict OpenAI-compatible endpoints reject otherwise valid requests. Set a provider-wide reasoningEfforts: [] default and opt in only model IDs with verified wire support.

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

Useful? React with 👍 / 👎.

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.

1 participant