Skip to content

feat(models): add SCX.ai general-purpose provider - #3333

Open
bhuvan2134686 wants to merge 1 commit into
theopenco:mainfrom
SouthernCrossAI:feat/scx-standard-provider
Open

feat(models): add SCX.ai general-purpose provider#3333
bhuvan2134686 wants to merge 1 commit into
theopenco:mainfrom
SouthernCrossAI:feat/scx-standard-provider

Conversation

@bhuvan2134686

@bhuvan2134686 bhuvan2134686 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Adds scx-ai-gp, a second SCX.ai provider for the general-purpose
(non-Turbo) tier, with GLM-5.2 as its first model.

SCX serves two distinct tiers from api.scx.ai. The existing scx-ai
provider represents the Turbo tier and carries the "Up to 4x faster"
model-card badge. That claim does not hold for the general-purpose tier,
so rather than widening scx-ai and diluting its badge, this adds a
separate provider id.

The existing scx-ai id is left untouched, so no persisted value changes
meaning and no data migration is required.

Changes to scx-ai

  • Display name is now "SCX.ai (Turbo)" so the two tiers are
    distinguishable in the UI. The id, badge, models and prices are
    unchanged.
  • Declares soc2: 1 and iso27001: true. These were previously omitted,
    which — since the compliance policy is fail-closed — meant orgs with
    requireSoc2 or requireIso27001 enabled silently skipped SCX.

New provider scx-ai-gp

Shares the api.scx.ai base URL, the LLM_SCX_AI_API_KEY credential,
the OpenAI-compatible request and streaming paths and the SCX wordmark
with the Turbo tier. It carries no modelCardBadge, so the existing
badge-presence sort keeps Turbo first on shared model pages.

The Turbo tier's tool_calls finish-reason normalization is deliberately
not extended to scx-ai-gp — the general-purpose tier returns the
OpenAI-standard finish_reason already, so parse-provider-response.ts
is unchanged.

Data policy: AU headquarters, no API training, no consumer training, no
prompt logging, 0-day retention, SOC 2 Type 1, ISO 27001.

GLM-5.2 mapping

Input $1.00 / M
Cached input $0.20 / M
Output $3.143 / M
Context 1,000,000
Max output 131,072

maxOutput is set from the endpoint's own validator rather than the
published catalogue: SCX rejects max_tokens above 131072 with
"expected a value <= 131072", while its model card advertises a 128k
ceiling.

Verification

  • pnpm format and pnpm build pass locally; unit tests left to CI.
  • No e2e run yet — happy to trigger /e2e for
    TEST_MODELS="scx-ai-gp/glm-5.2" if a maintainer would like it.

Summary by CodeRabbit

  • New Features
    • Added SCX.ai as a supported provider for standard inference.
    • Added GLM-5.2 with streaming, reasoning, tool use, JSON output, and a one-million-token context window.
    • Added provider branding and logo support.
    • Renamed the existing provider to SCX.ai (Turbo) for clearer selection.

Add scx-ai-gp, a second SCX.ai provider covering the general-purpose
(non-Turbo) tier, with GLM-5.2 as its first model.

The existing scx-ai id is left untouched so no persisted value changes
meaning and no data migration is required. It is renamed for display
only, to "SCX.ai (Turbo)", and now declares soc2: 1 and iso27001: true —
previously omitted, which meant orgs with requireSoc2 or requireIso27001
enabled silently skipped SCX under the fail-closed compliance policy.

scx-ai-gp shares the api.scx.ai base URL, the LLM_SCX_AI_API_KEY
credential, the OpenAI-compatible request and streaming paths and the
SCX wordmark with the Turbo tier. It carries no modelCardBadge, so the
badge-presence sort keeps Turbo first on shared model pages. The Turbo
tier's tool_calls finish-reason normalization is deliberately not
extended to it.

GLM-5.2 is priced at $1.00/M input, $0.20/M cached input and $3.143/M
output. maxOutput is 131072, taken from the endpoint's own validator
rather than the published catalogue, which advertises a 128k ceiling.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The PR adds scx-ai-gp as an SCX.ai provider variant. It registers GLM-5.2 metadata, configures the SCX API endpoint, reuses OpenAI response transformations, and maps the provider to the existing SCX icon.

Changes

SCX.ai GP integration

Layer / File(s) Summary
Provider catalog and model mapping
packages/models/src/models/zai.ts, packages/models/src/providers.ts
Adds the scx-ai-gp provider and its GLM-5.2 capabilities. Renames the existing provider to SCX.ai (Turbo).
Endpoint and response routing
packages/actions/src/get-provider-endpoint.ts, apps/gateway/src/chat/tools/transform-response-to-openai.ts, apps/gateway/src/chat/tools/transform-streaming-to-openai.ts
Routes scx-ai-gp to https://api.scx.ai/v1/chat/completions and applies the existing OpenAI transformations.
Provider icon mapping
packages/shared/src/components/provider-icons.tsx, apps/ui/src/components/provider-keys/provider-logo.ts
Maps scx-ai-gp to ScxIcon in shared and UI logo registries.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant Gateway
  participant SCXAPI
  Client->>Gateway: Send SCX.ai GP chat request
  Gateway->>SCXAPI: POST /v1/chat/completions
  SCXAPI-->>Gateway: Return response or stream
  Gateway-->>Client: Return OpenAI-compatible output
Loading

Possibly related PRs

Suggested reviewers: steebchen

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: adding the SCX.ai general-purpose provider.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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

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.

@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 `@apps/gateway/src/chat/tools/transform-streaming-to-openai.ts`:
- Line 1432: Remove scx-ai-gp from the Turbo finish-reason normalization case
group and add a separate scx-ai-gp branch that invokes transformOpenaiStreaming
without applying the end_turn, abort, or tool_use mappings. Add regression
coverage verifying all three finish reasons remain unchanged for the GP
provider.
🪄 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: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 045fda5b-b187-4ce5-bff6-cf2e246687bd

📥 Commits

Reviewing files that changed from the base of the PR and between b6181c4 and 381db0b.

📒 Files selected for processing (7)
  • apps/gateway/src/chat/tools/transform-response-to-openai.ts
  • apps/gateway/src/chat/tools/transform-streaming-to-openai.ts
  • apps/ui/src/components/provider-keys/provider-logo.ts
  • packages/actions/src/get-provider-endpoint.ts
  • packages/models/src/models/zai.ts
  • packages/models/src/providers.ts
  • packages/shared/src/components/provider-icons.tsx

case "inference.net":
case "together-ai":
case "scx-ai":
case "scx-ai-gp":

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 | 🟠 Major | ⚡ Quick win

Keep scx-ai-gp out of the Turbo finish-reason normalization branch.

Adding scx-ai-gp to this case group applies the mappings at Line [1469]-Line [1482]: end_turn becomes stop, abort becomes upstream_error, and tool_use becomes tool_calls. The PR objective states that this normalization must not apply to the GP provider.

Add a separate scx-ai-gp case that calls transformOpenaiStreaming without these mappings. Add regression tests for the three finish reasons.

Separate the GP provider case
+		case "scx-ai-gp": {
+			transformedData = transformOpenaiStreaming(
+				data,
+				usedModel,
+				supportsReasoning,
+			);
+			break;
+		}
+
 		case "mistral":
...
 		case "scx-ai":
-		case "scx-ai-gp":
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
case "scx-ai-gp":
case "scx-ai-gp": {
transformedData = transformOpenaiStreaming(
data,
usedModel,
supportsReasoning,
);
break;
}
case "mistral":
...
case "scx-ai":
🤖 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 `@apps/gateway/src/chat/tools/transform-streaming-to-openai.ts` at line 1432,
Remove scx-ai-gp from the Turbo finish-reason normalization case group and add a
separate scx-ai-gp branch that invokes transformOpenaiStreaming without applying
the end_turn, abort, or tool_use mappings. Add regression coverage verifying all
three finish reasons remain unchanged for the GP provider.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant