feat(providers): add SCX.ai as a JSON-configured OpenAI-compatible provider - #34752
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Greptile SummaryAdds SCX.ai as a JSON-configured OpenAI-compatible provider.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains; the SCX.ai entry now reaches the Add Model dropdown and maps through the form’s existing provider and credential submission contracts.
|
| Filename | Overview |
|---|---|
| litellm/llms/openai_like/providers.json | Defines the SCX.ai base URL, environment variables, token-parameter mapping, temperature ceiling, and supported chat-completions endpoint. |
| litellm/litellm_core_utils/get_llm_provider_logic.py | Adds SCX.ai provider and API-key detection for its canonical API base. |
| model_prices_and_context_window.json | Registers SCX.ai model pricing, context limits, caching rates, and supported capabilities. |
| litellm/proxy/public_endpoints/provider_create_fields.json | Adds the SCX.ai provider record consumed by the Add Model dropdown, fully resolving the prior missing-option report. |
| ui/litellm-dashboard/src/components/provider_info_helpers.tsx | Adds SCX.ai display-name, slug, logo, and model-placeholder mappings. |
| tests/test_litellm/llms/openai_like/test_scx_ai_provider.py | Tests provider registration, resolution, parameter transformation, metadata synchronization, and Add Model form availability. |
Reviews (6): Last reviewed commit: "Merge remote-tracking branch 'origin/lit..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Good catch on the Add Model dropdown, the display mapping on its own was not enough. The provider is now in Verified against the live proxy $ curl -sS http://localhost:4000/public/providers/fields | jq -c '.[] | select(.litellm_provider=="scx-ai")'
{"provider":"SCX_AI","provider_display_name":"SCX.ai","litellm_provider":"scx-ai","credential_fields":[{"key":"api_base","label":"API Base","placeholder":"https://api.scx.ai/v1","tooltip":null,"required":false,"field_type":"text","options":null,"default_value":null},{"key":"api_key","label":"API Key","placeholder":null,"tooltip":null,"required":true,"field_type":"password","options":null,"default_value":null}],"default_model_placeholder":"scx-ai/gpt-oss-120b"}The same push adds the five chat models to the cost map with published rates and capability flags, which restores cost tracking and lets $ curl -sS http://localhost:4000/v1/chat/completions -H "Authorization: Bearer sk-1234" -H "Content-Type: application/json" \
-d '{"model":"scx-gemma-4","messages":[{"role":"user","content":"What is the weather in Sydney? Use the tool."}],"tools":[{"type":"function","function":{"name":"get_weather","description":"Get the weather for a city","parameters":{"type":"object","properties":{"city":{"type":"string"}},"required":["city"]}}}],"max_tokens":128}' \
| jq -c '.choices[0].message.tool_calls[0].function'
{"arguments":"{\"city\":\"Sydney\"}","name":"get_weather"}The PR description is updated with the full run |
|
Placeholder note is addressed, the Add Model model field now defaults to Description trimmed as well |
Replaces the five launch models with the two that SCX.ai now leads on. Both are live on api.scx.ai and both were verified against it for tool calling, json_object and json_schema output, reasoning, prompt caching, and, for Qwen3.8 Max, image input Pricing follows SCX's published USD rates. GLM-5.2 lands at $0.55/M input and $1.9255/M output, tracking the recent GLM-5.2 market repricing; Qwen3.8 Max at $1.815/M and $5.4461/M sits under the only other seller of that model, and is the first Qwen3.8 Max entry in the catalog Also corrects a metadata bug the removed entries carried: they set max_tokens equal to max_input_tokens, conflating the context window with the output cap. Both new entries declare a max_output_tokens of 131072, which is what the endpoint's own validator enforces The Add Model placeholder moves to scx-ai/GLM-5.2 now that MiniMax-M2.7 is no longer in the catalog
…itellm_scx_ai_provider
The constraint was 1.0, so anything above that was silently clamped down. SCX accepts [0.0, 2.0), verified live against both GLM-5.2 and Qwen3.8 Max: 1.5, 1.99 and 1.999 all return 200, while 2.0 returns 400 with "Temperature should be in [0.0, 2.0)" Since the clamp is an inclusive min(), 2.0 cannot be the ceiling or it would pass through a value the endpoint rejects. 1.99 is the practical maximum The clamp test now pins both ends: 2.5 comes back as 1.99, and 1.7 rides through untouched where it used to be flattened to 1.0
|
Docs page is up in BerriAI/litellm-docs#808; the documentation and code-quality jobs here go green once it merges. |
|
@greptileai please re-review. The model list changed since your last pass. @tin-berri, this adds SCX.ai; docs page is in BerriAI/litellm-docs#808. |
…itellm_scx_ai_provider # Conflicts: # ui/litellm-dashboard/src/components/provider_info_helpers.tsx
|
All review comments are addressed. The Greptile P1 on the Add Model dropdown is fixed and I have replied in the thread and resolved it; that was the only inline comment on this PR. On the two red checks, code-quality and documentation both fail on the same assertion and neither is a defect in this branch. test-code-quality.yml checks out BerriAI/litellm-docs into docs/my-website without a ref, so it always reads litellm-docs main. The page that documents SCX_API_KEY lives on the branch behind BerriAI/litellm-docs#808, which is still open, so test_env_keys.py cannot see it and raises "Environment variables read under ./litellm but mentioned nowhere in the docs: [SCX_API_KEY]". No commit on this PR can turn those jobs green. I reproduced both sides locally. Pointing docs/my-website at litellm-docs main gives exactly the CI error; pointing it at the #808 branch prints "Every environment variable read under ./litellm is documented". Merging #808 clears both jobs here. I have also added SCX_API_KEY and SCX_API_BASE as rows in the environment variables reference table in docs/proxy/config_settings.md on #808, so the credentials are listed alongside the other providers rather than only on the provider page. @greptileai please re-review. @tin-berri @ryan-crabbe-berri this is ready on the code side; the only thing gating green CI is the docs PR at BerriAI/litellm-docs#808. |
|
@krrish-berri-2 @mateo-berri @ryan-crabbe-berri asking for a look when one of you has a moment. This has been open since 27 July with a review request that has not been picked up, and I cannot add or re-request reviewers from a fork, the API returns 404, so a comment is the only ping I have. This follows the same shape you approved in #24294 for AIHubMix, a JSON entry in CI is 77 passing and 2 failing. The two failures are |
* docs(providers): add the SCX.ai provider page Documents the scx-ai route ahead of BerriAI/litellm#34752, which registers SCX.ai as a JSON-configured OpenAI-compatible provider Covers the two chat models on the route, GLM-5.2 and Qwen3.8 Max, with their context and output limits, plus SDK and proxy usage for streaming, function calling, structured output and image input. Every capability listed was checked against the live endpoint Also records two behaviours worth knowing: max_completion_tokens is sent upstream as max_tokens, and temperature is accepted in [0.0, 2.0) with 2.0 itself rejected, so LiteLLM clamps to 1.99 The page also gives SCX_API_KEY somewhere to live, which the env-key documentation gate in the main repo requires before that PR can go green * docs(proxy): document the SCX.ai environment variables Add SCX_API_KEY and SCX_API_BASE to the environment variables reference table so the credential names are discoverable from the proxy settings page, matching how the other providers list theirs.
mateo-berri
left a comment
There was a problem hiding this comment.
Rates don't match https://scx.ai/pricing, the suggestions below have the right ones. The docs URL is wrong too, and staging needs merging in
…itellm_scx_ai_provider Resolves the three conflicts against the JSON provider registry refactor. The hardcoded api.scx.ai base-url branch in get_llm_provider_logic.py is dropped in favour of the generic JSONProviderRegistry.get_by_base_url lookup, which reads the same base_url and api_key_env from providers.json and additionally honours an explicitly passed api_key. constants.py and types/utils.py keep both the cognition and scx-ai entries added on either side.
Applies the review suggestions. The cost map now carries the rates published on https://scx.ai/pricing, GLM-5.2 at 0.61 in, 0.22 cached, 1.98 out and Qwen3.8-Max at 1.65 in, 0.21 cached, 4.99 out per million tokens, and cites that page as the source rather than a third party gateway. The provider link is corrected to https://docs.litellm.ai/docs/providers/scx_ai to match the page that shipped as scx_ai.md. Both the primary files and their backup mirrors are updated.
|
@mateo-berri thanks for the review, all six suggestions are applied and the branch is up to date with Prices now match https://scx.ai/pricing exactly, GLM-5.2 at 0.61 in, 0.22 cached, 1.98 out and Qwen3.8-Max at 1.65 in, 0.21 cached, 4.99 out per million tokens, in The staging merge dropped the hardcoded The docs jobs that were red are green now that #808 has merged. Ready for another look when you have a moment. |
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 7d9e375. Configure here.
mateo-berri
left a comment
There was a problem hiding this comment.
LGTM. Thanks for the contribution!
3029f7e
into
BerriAI:litellm_internal_staging
TLDR
Problem this solves:
openai/with a customapi_basemax_tokensrather thanmax_completion_tokens, and capstemperatureHow it solves it:
scx-aiinlitellm/llms/openai_like/providers.jsonwith the parameter mapping and the ceiling as a constraint, so no Python module is neededRelevant issues
Docs live in the other repo, so the provider page goes up separately in BerriAI/litellm-docs#808. That one is a prerequisite here:
documentationandcode-qualityboth runtests/documentation_tests/test_env_keys.py, which checks outBerriAI/litellm-docsand fails whileSCX_API_KEYis read under./litellmbut mentioned nowhere in the docs. Both jobs go green once it mergesLinear ticket
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
@greptileaito re-request a review after pushing changes)Delays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
All captured at
1e24f93d3against the real SCX.ai API, with the proxy started asLITELLM_LOCAL_MODEL_COST_MAP=True python litellm/proxy/proxy_cli.py --config scx_config.yaml --port 4000on a config with both models pointed atos.environ/SCX_API_KEYChat completions, with the cost header showing the new rates being applied
Tool calling and
json_schemastructured output on bothImage input on Qwen3.8 Max, which is the one of the two that declares
supports_vision, sending a 64x64 solid red PNG as a data URIThe Add Model form reads
/public/providers/fields, which now returns the providerWith that proxy running and
npm run devinui/litellm-dashboard, Models and Endpoints then Add Model lists SCX.ai in the Provider dropdown with its logoType
New Feature
Changes
providers.jsoncarries the base URL,SCX_API_KEY, theSCX_API_BASEoverride, themax_completion_tokenstomax_tokensmapping and atemperature_maxof 1.99. SCX acceptstemperaturein[0.0, 2.0)and returns a 400 on 2.0 exactly, and the clamp is an inclusivemin(), so 2.0 would let through a value the endpoint rejects. The slug is registered inLlmProviders, the OpenAI-compatible provider and endpoint lists, the api base autodetection branch, and the endpoint support matrixTwo chat models go into the cost map. GLM-5.2 has a 1M context window and is text only; Qwen3.8 Max has a 1M window and takes image input. Both cap output at 131072, which is what the endpoint's own validator enforces rather than what the catalogue advertises, and both do implicit prompt caching, so each carries a cache read rate
The dashboard needs both the display metadata in
provider_info_helpers.tsxand an entry inprovider_create_fields.json, since the Add Model form renders from the latterTests cover registration, config values, model resolution, api base override and autodetection, the temperature clamp, the parameter mapping, router config, cost map and backup sync, the create-fields entry and the dashboard helpers
I work at SCX.ai
QA runbook
Export
SCX_API_KEY, start the proxy on the config above and run the curl commands in the proof sectionFinal Attestation
Note
Low Risk
Additive provider registration and pricing metadata only; no changes to auth, routing core, or existing providers.
Overview
Adds native
scx-airouting so callers can usescx-ai/<model>instead of a custom OpenAIapi_base.Registers the provider in
providers.jsonwithSCX_API_KEY/SCX_API_BASE, mapsmax_completion_tokens→max_tokens, and clamps temperature to 1.99 (SCX rejects 2.0). Chat-only. Cost map includesscx-ai/GLM-5.2(text, ~1M context) andscx-ai/Qwen3.8-Max(vision), both with prompt-cache rates.Dashboard Add Model lists SCX.ai with logo and credential fields. Tests cover resolution, autodetection, param mapping, temperature clamp, and metadata sync.
Reviewed by Cursor Bugbot for commit 7d9e375. Bugbot is set up for automated code reviews on this repo. Configure here.