Repository navigation
feat(providers): add superbot as an OpenAI-compatible provider - #47505
superbot-helper wants to merge 5 commits into
Conversation
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.
|
|
Merging this PR will not alter performance
|
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.
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", |
There was a problem hiding this comment.
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.
PR overviewAdds 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 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.
TLDR
Problem this solves:
superbot-gg/superbotcalls fail before reaching superbot, because LiteLLM does not know the providerHow it solves it:
superbotas a JSON-configured OpenAI-compatible provider, keyedsuperbot-ggso that the model idsuperbotdoes not collide with the provider id (a provider whose id equals one of its model ids makesget_llm_providersplit the bare name and raiseIndexError, which the first CI run on this PR found)SUPERBOT_API_KEYandSUPERBOT_API_BASE, defaulting tohttps://api.superbot.gg/v1superbot/superbotandsuperbot/superbot-fastat the list prices on https://superbot.gg/pricingUser Flow
Before: a developer with a superbot key has no
superbot/prefix to use"model": "superbot-gg/superbot"openai/superbotplus a hand-setapi_base, and spend logs attribute the call to OpenAIAfter: the same request works and is attributed to superbot
SUPERBOT_API_KEYand adds asuperbot-gg/superbotdeploymentNotes
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 tohttps://docs.litellm.ai/docs/providers/superbot.Model ids stay
superbotandsuperbot-fast; the provider key, enum value, endpoint-support and Add Model entries and the two cost-map keys aresuperbot-gg.The two endpoint-support files are generated by
scripts/generate_provider_endpoints_support.py— upstream added the generator and a CI--checkafter 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, astest_reka_provider.pyasserts, and superbot also answers/v1/messagesand/v1/responsesitself.max_output_tokens(131,072) is the per-requestmax_tokensceiling the API enforces: the router's livelimits.max_tokens_ceiling, together with its model catalog'smax_output_tokensfor 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 sendingmax_tokens: 131072is served, not refused: measured 2026-10-20 againstsuperbot-fast, HTTP 200 (a key whose own ceiling sits lower has the cap clamped and named inx-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 UIprovider_info_helpersmap plus its test (the Add Model slug must resolve tosuperbot-gg, which the dashboard drift test pins).Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
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 moreScreenshots / Proof of Fix
Not run. I have not run
tests/unit/llms/openai_like/test_superbot_provider.pyormake 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 mockedrespxtest that mirrorstest_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 onmainatba61ecd. CI runs the test file: the first run failed on the id collision above,2c3fb40fixes it.llms-providersis green oneb6dcb3, 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/responsesand/v1/messagesgo through the gateway bridge, as for any JSON providermax_output_tokens131,072, taken from the router's live limit configuration read 2026-10-20; no public page prints the ceiling. Upstream retired the cost map'smax_tokensfield 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 absentFinal Attestation