Repository navigation
feat(providers): add AI Stupid Level as a JSON-configured OpenAI-compatible provider - #47336
StudioPlatforms wants to merge 8 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Merging this PR will not alter performance1 warning
Comparing |
Adds the 10 routing modes (aistupidlevel/auto, auto-coding, auto-tooling, ...) to the cost map and its backup, in the same shape as the Fireworks router entries: provider, chat mode, the router's limits and capability flags, with no prices. The limits (262,144 in, 64,000 out) are the smallest across the models it routes to. There are no prices because each request is billed by the routed model's provider to the caller's own key. Tools that read model lists from the cost map can now show these modes, and get_model_info resolves them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
I added a second commit. It puts the 10 routing modes into the model cost map and its backup, in the same shape as the With these entries, tools that read their model lists from the cost map can show the modes, and These pass locally:
|
|
About the CLA check: the signing page for this repo can't load the agreement at the moment. cla-assistant answers "Bad credentials" when it fetches the linked gist, so there's nothing to sign. This is reported as cla-assistant/cla-assistant#1211 and #1212. I'll sign as soon as it loads again. The commits on this PR are now linked to the StudioPlatforms account. |
…evel-provider Resolve conflict in litellm/llms/openai_like/providers.json: keep both the upstream 'refuseless' provider and our 'aistupidlevel' provider entries.
…ap rows Upstream BerriAI#48471 retired max_tokens in favor of max_input_tokens and max_output_tokens; our routing-mode rows already carry both.
|
I merged the latest |
…evel-provider Conflicts, all from both sides adding a provider at the same place: streamlake in constants.py, types/utils.py and providers.json, and the aiand/* rows in the cost map and its backup. Both are kept, with upstream first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merged the latest
|
…ey is missing With AISTUPIDLEVEL_API_KEY unset and no api_key passed, the shared chat path fell back to litellm.openai_key / OPENAI_API_KEY and sent that key to aistupidlevel.info. JSON providers can now opt in to `special_handling.require_api_key`: the request is refused with an AuthenticationError naming the provider's env var before any client is built (the OpenAI client would otherwise read OPENAI_API_KEY itself). aistupidlevel sets it. Other providers are unchanged. Tests cover sync and async, and that the provider's own key is sent when both are present.
TLDR
Problem this solves:
openai/with acustom
api_base. Tools are then gated on the cost map, and the Admin UI has no entry.How it solves it:
aistupidlevelinlitellm/llms/openai_like/providers.json. The router acceptsmax_completion_tokensas sent, so there is no param mapping.provider_infomarkssupports_function_calling, because every model the router can choose supports tools.LlmProviders.AISTUPIDLEVEL, adds the provider and its base URL to the openai-compatiblelists in
constants.py, adds it to both endpoint matrices (chat, plus the messages and responsesbridges), and adds an Add Model form entry.
auto-coding,auto-reasoning, ...), so themodel behind them changes per request, and tokens are billed by the chosen model's provider to
the user's own key.
Relevant issues
The docs page is in BerriAI/litellm-docs#2453, which should merge first so that
test_env_keys.pyfindsAISTUPIDLEVEL_API_KEY/AISTUPIDLEVEL_API_BASE.Pre-Submission checklist
tests/unit/llms/openai_like/test_aistupidlevel_provider.py(13 tests, all mocked with respx: registration, config, env and api_base resolution, URL
autodetection, tool params, Add Model form, endpoint matrix, chat request, tools forwarded,
Responses bridge, /v1/messages bridge)
Screenshots / Proof of Fix
Local:
pytest tests/unit/llms/openai_like/test_aistupidlevel_provider.py test_json_providers.py test_reka_provider.py:39 passed
ruff check/ruff format --check: cleanLive, from this branch, against https://aistupidlevel.info with
X-ASL-Sandbox: true(real routing,mock completion, no provider call):
Reviewers can test the same way at no cost: any router key plus the
X-ASL-Sandbox: trueheader.