Skip to content

feat(providers): add superbot as an OpenAI-compatible provider - #47505

Open
superbot-helper wants to merge 5 commits into
BerriAI:mainfrom
superbot-helper:litellm_superbot_provider
Open

superbot-helper wants to merge 5 commits into
BerriAI:mainfrom
superbot-helper:litellm_superbot_provider

Conversation

@superbot-helper

@superbot-helper superbot-helper commented Oct 20, 2026 •

Copy link
Copy Markdown

TLDR

Problem this solves:

  • superbot-gg/superbot calls fail before reaching superbot, because LiteLLM does not know the provider
  • Spend tracking has no superbot prices

How it solves it:

  • Registers superbot as a JSON-configured OpenAI-compatible provider, keyed superbot-gg so that the model id superbot does not collide with the provider id (a provider whose id equals one of its model ids makes get_llm_provider split the bare name and raise IndexError, which the first CI run on this PR found)
  • Reads SUPERBOT_API_KEY and SUPERBOT_API_BASE, defaulting to https://api.superbot.gg/v1
  • Adds superbot to the Admin UI Add Model form and the endpoint support matrix
  • Prices superbot/superbot and superbot/superbot-fast at the list prices on https://superbot.gg/pricing
  • Responses and Anthropic Messages calls bridge to chat completions

User Flow

Before: a developer with a superbot key has no superbot/ prefix to use

  1. They send POST https://litellm-domain/v1/chat/completions with "model": "superbot-gg/superbot"
  2. They get a 400 saying the LLM provider was not provided
  3. They fall back to openai/superbot plus a hand-set api_base, and spend logs attribute the call to OpenAI

After: the same request works and is attributed to superbot

  1. The proxy admin sets SUPERBOT_API_KEY and adds a superbot-gg/superbot deployment
  2. The developer sends the same request and gets a 200 with the completion, billed at the list price
  3. https://litellm-domain/ui/?page=models now lists superbot in the Add Model provider dropdown

Notes

superbot is your own AI agent: anything you can do on your computer, it can do, fast, and it runs your recurring tasks on a schedule across all your devices. It also has an OpenAI-compatible API with one base URL and one caller key (sbc_...). I work on superbot. Rates are USD per 1M tokens, API and MCP lane, from https://superbot.gg/pricing (read 2026-10-20): 1.00 input, 5.00 output, 0.05 cache read, 1.25 cache write; reasoning tokens bill as output. The API page is https://superbot.gg/api. A docs page for this provider is in a companion PR, BerriAI/litellm-docs#2488, because the endpoint-support entries link to https://docs.litellm.ai/docs/providers/superbot.

Model ids stay superbot and superbot-fast; the provider key, enum value, endpoint-support and Add Model entries and the two cost-map keys are superbot-gg.

The two endpoint-support files are generated by scripts/generate_provider_endpoints_support.py — upstream added the generator and a CI --check after this PR opened — so they are regenerated rather than hand-edited; the generator derives chat, messages and responses true because LiteLLM bridges messages and responses onto chat completions for any JSON provider, as test_reka_provider.py asserts, and superbot also answers /v1/messages and /v1/responses itself. max_output_tokens (131,072) is the per-request max_tokens ceiling the API enforces: the router's live limits.max_tokens_ceiling, together with its model catalog's max_output_tokens for the model version both ids serve, read 2026-10-20; the ceiling was raised from 65,536 on 2026-10-18 and these entries kept the old figure. A request sending max_tokens: 131072 is served, not refused: measured 2026-10-20 against superbot-fast, HTTP 200 (a key whose own ceiling sits lower has the cap clamped and named in x-sbr-ignored, never a 400).

The change follows #44278 (Reka) and #41034 (OpenInfer): providers.json, constants.py, types/utils.py, provider_create_fields.json, both endpoint-support files, both cost-map files, one unit test file, and the Admin UI provider_info_helpers map plus its test (the Add Model slug must resolve to superbot-gg, which the dashboard drift test pins).

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have added meaningful tests
  • The handful of test files covering my change pass locally, e.g. uv run pytest tests/unit/<your_test_file>.py -v. Leave the suites (make test-unit-*, make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more
  • My PR passes all required CI/CD checks (e.g., lint, schema.d.ts sync check, etc.)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • Every automated review on my PR's latest commit has finished, and I have addressed or replied to each of its findings before requesting a maintainer review

Screenshots / Proof of Fix

Not run. I have not run tests/unit/llms/openai_like/test_superbot_provider.py or make lint (the dev environment, which builds a Rust extension, was not installed where I prepared this PR), and I have made no live call to https://api.superbot.gg/v1 for this PR. The test file is a mocked respx test that mirrors test_reka_provider.py: it asserts the provider enum and lists, env and explicit-key resolution, base autodetect, the Add Model form entry, the endpoint-support rows, the two cost-map rows, and the exact upstream URL, bearer header and body for chat completions, Responses and Anthropic Messages. It compiles (py_compile), the six changed JSON files parse, and the patch applies cleanly on main at ba61ecd. CI runs the test file: the first run failed on the id collision above, 2c3fb40 fixes it. llms-providers is green on eb6dcb3, which carries the output-limit correction and its test. The checklist items above for local tests, CI and automated reviews stay unticked until they are true.

Type

🆕 New Feature

Caveats (if any)

Low

  • /v1/responses and /v1/messages go through the gateway bridge, as for any JSON provider
  • The two cost-map rows state max_output_tokens 131,072, taken from the router's live limit configuration read 2026-10-20; no public page prints the ceiling. Upstream retired the cost map's max_tokens field in refactor(cost-map): drop the legacy max_tokens field in favor of max_input_tokens and max_output_tokens #48471 after this PR opened, so the rows no longer carry it and the test asserts it stays absent
  • The tests were not run before filing; CI is the first run

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR

Registers superbot as a JSON-configured OpenAI-compatible provider (SUPERBOT_API_KEY, SUPERBOT_API_BASE), adds it to the Admin UI Add Model form and the endpoint support matrix, prices superbot/superbot and superbot/superbot-fast at the list prices on https://superbot.gg/pricing, and adds a mocked unit test.
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@codspeed

codspeed Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

⚠️ 1 benchmark spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

✅ 32 untouched benchmarks


Comparing ux-xd:litellm_superbot_provider (eb6dcb3) with main (6b387e8)

Open in CodSpeed

@codecov

codecov Bot commented Oct 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

…uperbot resolves

A provider whose id equals one of its model ids loops back into get_llm_provider, which splits the bare name on '/' and raises IndexError, so superbot/superbot never reached the API. The provider key, the enum value, the endpoint-support and Add Model entries and the two cost-map keys are now superbot-gg; the model ids stay superbot and superbot-fast.
The router's live limit configuration (config v144, read 2026-10-20) publishes
limits.max_tokens_ceiling = 131072, and its model catalog reports
max_output_tokens = 131072 for deepseek-v4.1-flash-uncensored@prod, the model
version both house ids serve. The entries stated 65536, the ceiling before it
was raised on 2026-10-18.

Nothing else changed. Upstream tooling is not re-run here; this PR's CI runs it.
The cost-map rows moved to the router's live ceiling, 131072, so the test
that asserts them moves with it: max_output_tokens and max_tokens are both
131072 now. The first push of this change left the test at 65_536, which is
what llms-providers caught.

Upstream tooling is not re-run here; this PR's CI runs it.
superbot-helper added a commit to superbot-helper/litellm-docs that referenced this pull request Oct 20, 2026
The limits table now states 131,072 output tokens. It is the per-request `max_tokens`
ceiling the API enforces: the router's live `limits.max_tokens_ceiling`, together with
its model catalog's `max_output_tokens` for the model version both model ids serve,
read 2026-10-20; the ceiling was raised from 65,536 on 2026-10-18 and this table kept
the old figure. A request sending `max_tokens: 131072` is served, not refused (measured
2026-10-20 against `superbot-fast`, HTTP 200).

The same correction landed in BerriAI/litellm#47505, anomalyco/models.dev#10594 and
charmbracelet/catwalk#689.
Re-cut onto the current main: eleven files, content rebuilt on the tip.
},
"superbot-gg": {
"base_url": "https://api.superbot.gg/v1",
"api_key_env": "SUPERBOT_API_KEY",

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.

Medium: Missing Superbot credentials expose an unrelated OpenAI key

When neither an explicit key nor SUPERBOT_API_KEY is provided, this provider resolves its key to None, after which _complete_custom_openai() (litellm/main.py:2809–2813) falls back to OPENAI_API_KEY and sends it as a Bearer credential to api.superbot.gg; this was confirmed using the checked-in resolver/dispatcher with a mocked transport. Reject missing Superbot credentials before dispatch, or restrict the shared OpenAI-key fallback to OpenAI destinations.

@veria-ai

veria-ai Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

PR overview

Adds Superbot as an OpenAI-compatible provider in LiteLLM’s provider configuration.

One issue remains open: when Superbot credentials are missing, the shared dispatcher falls back to OPENAI_API_KEY and sends it to api.superbot.gg. This exposes an unrelated provider credential under a confirmed fallback path, though it requires an OpenAI key to be configured and no Superbot key to be supplied. No issues have been addressed yet.

Open issues (1)

Fixed/addressed: 0 · PR risk: 6/10

superbot-helper added a commit to superbot-helper/litellm-docs that referenced this pull request Nov 9, 2026
superbot is an OpenAI-compatible provider added in BerriAI/litellm#47505; this page is the docs.litellm.ai target that models.litellm.ai links to. It documents the superbot-gg/ route, SUPERBOT_API_KEY, the optional SUPERBOT_API_BASE, chat/streaming/reasoning-effort/Responses examples, the proxy config, cost tracking and a custom base URL.

Rebased onto main 704f99b: the provider sidebar moved to providersSidebar, so the entry is applied in its More Providers A-Z list between strands_decider and synthetic. The page itself is unchanged from the reviewed revision.

This branch has not been deployed

No deployments
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.

2 participants