litellm/tests/unit/llms/openai_like
Lachlan van der Drift ac7674625c
feat(provider)!: add ResetData and stop sending OPENAI_API_KEY to keyless JSON-configured providers (#50819)
* feat(provider): add ResetData as a JSON-configured provider

Add ResetData (https://docs.resetdata.ai), an Australian sovereign
AI-inference platform with an OpenAI-compatible API, following the
libertai/parasail/chutes JSON-configured provider pattern.

- providers.json: base_url, api_key_env, api_base_env,
  supported_endpoints (/v1/chat/completions)
- constants.py: openai_compatible_endpoints + openai_compatible_providers
- LlmProviders.RESETDATA enum member
- provider_endpoints_support.json + backup: chat_completions only
  (further endpoints to follow as they are validated)
- model catalog (root + packaged backup, byte-identical): 6 chat models
  from the live /v1/models API with context windows, output caps, and
  capability flags. Pricing entries land in a follow-up once official
  USD rates are published.
- Admin UI: provider logo + wiring + dashboard test
- tests: tests/unit/llms/openai_like/test_resetdata_provider.py (9 tests)

Model ids are three segments (resetdata/zai/glm-5.3) because ResetData
model slugs are provider/model form; get_llm_provider strips only the
first segment. Verified end-to-end against the live API through a local
proxy (streaming and non-streaming).

* fix(provider): remove retired resetdata/zai/glm-5.2 from model catalog

ResetData retired zai/glm-5.2 on 2026-11-10, so the catalog entry pointed at a model the API now rejects. Removed the entry from both copies of the cost map, which must stay byte-identical.

Flagged by Cursor Bugbot during PR review.

* fix(provider): wire ResetData into wildcards and Add Model, and sync its models with the live catalog

Register resetdata_models so resetdata/* wildcards and get_valid_models list the ResetData rows. Add ResetData to the Admin UI Add Model form. Drop zai/glm-5.2, which ResetData retired, and add deepseek/deepseek-v4.1-flash, which /v1/models now lists and which accepts images. Replace the structural tests with behavior tests for routing, the responses bridge, wildcard expansion, backup parity, and the Add Model entry

* fix(openai_like): stop JSON-configured providers from borrowing the OpenAI key, regenerate endpoint support

A chat call to a JSON-configured provider with no key of its own fell back to OPENAI_API_KEY
and sent it to that provider's host. It now fails with an AuthenticationError naming the
provider's key env, matching the embeddings path. A caller-supplied client keeps working.

* fix(openai_like): apply the provider key check to HTTP handler clients and return the error as a value

* fix(provider): keep JSON providers off the OpenAI key on every endpoint and price ResetData

Transcription, speech and image generation now fail locally with 401 when a
JSON-configured provider has no key of its own, instead of sending OPENAI_API_KEY
to that provider. ResetData maps max_completion_tokens to max_tokens, its rows carry
USD prices converted from its AUD rates, and the private deepseek-v4.1-flash row is
removed. The CoralBricks integration test now expects 401 for the missing key

* fix(provider): keep JSON providers off the OpenAI key on moderation and realtime client secrets

Moderation now sends a JSON provider its own key (explicit or env) and fails locally without one. Realtime client secrets and calls fail locally too. The missing-key helper moves next to the JSON provider code so the realtime module can use it

* fix(realtime): check the JSON provider key in the realtime callers that send it

* test(json-providers): mark the new test bindings Final

* fix(openai_like): give JSON providers a local 401 on text completions with no key, and drop unproven ResetData caching flags

* fix(openai_like): accept a forwarded Authorization header in the JSON provider key check, and bill OpenAI-compatible transcription from its provider's price row

A JSON-configured deployment that authenticates through an Authorization header in headers or extra_headers no longer gets a local 401 on chat, text completion, image and realtime setup, the routes that send that header upstream. Transcription, speech and moderation drop caller headers, so the check still refuses there.

The OpenAI transcription handler now labels the response with the provider that served it, so Groq, Meta and ResetData transcription bill from their price rows instead of recording $0. ResetData's whisper-large-v3-turbo joins the cost map at 0.0003 AUD per minute and its endpoint support lists audio transcriptions.

* feat(resetdata): add DeepSeek V4.1 Flash to the cost map

ResetData's /models list, which its docs call authoritative, serves deepseek/deepseek-v4.1-flash with reasoning, image input and a cached-input price. Prices are ResetData's AUD rates at the same 1 AUD = 0.67566 USD rate as the other rows

* revert(resetdata): drop the DeepSeek V4.1 Flash cost map row

ResetData marks deepseek/deepseek-v4.1-flash access_level private for a limited tier, and its docs describe GET /api/v1/models as the list a given key can reach, not the public catalog. So the row stays out, as the PR's decisions say. This reverts 82c4e258a4 and leaves the tree identical to 86b9afc649

* fix(json_providers): keep the caller's Authorization header on the HTTP handler path

With EXPERIMENTAL_OPENAI_BASE_LLM_HTTP_HANDLER set, a JSON-configured provider deployment authenticated only by an Authorization header fell back to OPENAI_API_KEY as its api_key, and OpenAIGPTConfig.validate_environment overwrote the caller's header with it. JSON-configured providers now never take the OpenAI key as a fallback

* fix(json_providers): price gateway transcription at OpenAI's row and replace the OpenAI key with a lowercase caller authorization header

* fix(cost): price gateway transcription at OpenAI's row when the deployment's own row lists no transcription price

* fix(cost): bill OpenAI-compatible transcription from its own row when that row declares a zero rate

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-11-20 22:20:25 -08:00
..
chat fix(streaming): keep merged think tags balanced and split SSE lines only on CR/LF (#48755) 2026-10-28 17:00:29 -07:00
embedding test: migrate local_testing SDK and provider tests out of build_and_test (#45760) 2026-10-10 23:14:25 +00:00
messages feat(providers): add Sarvam Token Factory v2 models (#49792) 2026-11-18 13:19:05 +00:00
responses test: move tests/test_litellm/llms into tests/unit/llms (#43191) 2026-09-25 12:43:23 -07:00
__init__.py test: add package initializers to migrated unit test directories 2026-09-20 11:52:07 +00:00
test_abliteration_provider.py feat(abliteration): add model pricing and capabilities (#48498) 2026-10-26 18:08:29 -07:00
test_aiand_provider.py fix(aiand)!: show ai&'s name and logo, and sync ai&'s model list (#49158) 2026-10-30 10:55:26 -07:00
test_assemblyai_provider.py refactor(llms): expose public names for private provider helpers (#45037) 2026-10-07 08:49:25 -07:00
test_charity_engine.py test: move tests/test_litellm/llms into tests/unit/llms (#43191) 2026-09-25 12:43:23 -07:00
test_cognition_provider.py refactor(llms): expose public names for private provider helpers (#45037) 2026-10-07 08:49:25 -07:00
test_coralbricks_provider.py feat(providers): add CoralBricks as a native provider (#44700) 2026-10-12 21:56:59 +00:00
test_cortecs_provider.py feat: generate provider_endpoints_support.json from the cost map (#48619) 2026-10-27 12:06:55 -07:00
test_dynamic_config.py feat(providers): add Sarvam Token Factory v2 models (#49792) 2026-11-18 13:19:05 +00:00
test_empiriolabs_provider.py feat: update EmpirioLabs models in model_prices_and_context_window.json (#49980) 2026-11-04 20:11:52 +00:00
test_hostinger_router_provider.py feat!: add Hostinger Router as an OpenAI-compatible provider (#44863) 2026-10-31 00:38:45 -07:00
test_inferenceapis_provider.py feat(providers): add Inference APIs as OpenAI-compatible provider (#41669) 2026-10-15 08:17:36 -07:00
test_json_loader.py fix(crusoe): update base URL to current endpoint (#33121) 2026-10-15 19:10:58 -07:00
test_json_providers.py feat(provider)!: add ResetData and stop sending OPENAI_API_KEY to keyless JSON-configured providers (#50819) 2026-11-20 22:20:25 -08:00
test_kyma_provider.py fix(cost): split a provider-reported total between input and output by the cost map rate ratio (#49357) 2026-10-31 09:04:50 -07:00
test_libertai_provider.py feat: generate provider_endpoints_support.json from the cost map (#48619) 2026-10-27 12:06:55 -07:00
test_meta_provider.py test: move tests/test_litellm/llms into tests/unit/llms (#43191) 2026-09-25 12:43:23 -07:00
test_model_info.py test: move tests/test_litellm/llms into tests/unit/llms (#43191) 2026-09-25 12:43:23 -07:00
test_openinfer_provider.py refactor(cost-map): drop the legacy max_tokens field in favor of max_input_tokens and max_output_tokens (#48471) 2026-10-26 17:03:05 -07:00
test_pinstripes_provider.py test: move tests/test_litellm/llms into tests/unit/llms (#43191) 2026-09-25 12:43:23 -07:00
test_prism_provider.py feat: generate provider_endpoints_support.json from the cost map (#48619) 2026-10-27 12:06:55 -07:00
test_provider_affinity_forwarding.py test: move tests/test_litellm/llms into tests/unit/llms (#43191) 2026-09-25 12:43:23 -07:00
test_refuseless_provider.py feat(refuseless): add provider and model pricing (#48497) 2026-10-26 18:08:42 -07:00
test_reka_provider.py feat: generate provider_endpoints_support.json from the cost map (#48619) 2026-10-27 12:06:55 -07:00
test_resetdata_provider.py feat(provider)!: add ResetData and stop sending OPENAI_API_KEY to keyless JSON-configured providers (#50819) 2026-11-20 22:20:25 -08:00
test_sarvam_provider.py feat(providers): add Sarvam Token Factory v2 models (#49792) 2026-11-18 13:19:05 +00:00
test_scx_ai_provider.py feat(cost-map): add scx-ai DeepSeek-V4.1-flash, GLM-5.3 and Kimi-K3 (#46496) 2026-10-14 20:22:16 -07:00
test_streamlake_provider.py feat!: add StreamLake provider metadata (#41006) 2026-10-28 20:19:06 -07:00
test_tensormesh_provider.py test: move tests/test_litellm/llms into tests/unit/llms (#43191) 2026-09-25 12:43:23 -07:00
test_vispark_provider.py feat(litellm): add Vispark provider with Vision Small/Medium/Large (#41192) 2026-11-17 00:48:52 -08:00
test_wally_provider.py feat(providers): add Wally as an OpenAI-compatible provider (#45662) 2026-11-04 00:21:25 +00:00
test_xiaomi_mimo.py test: move tests/test_litellm/llms into tests/unit/llms (#43191) 2026-09-25 12:43:23 -07:00
test_zerogpu_provider.py feat(providers): add ZeroGPU as an OpenAI-compatible provider (#43874) 2026-10-28 12:40:32 -07:00