Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions litellm/llms/openai_like/providers.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,13 @@
"assemblyai": {
"base_url": "https://llm-gateway.assemblyai.com/v1",
"api_key_env": "ASSEMBLYAI_API_KEY"
},
"charity_engine": {
"base_url": "https://api.charityengine.services/remotejobs/v2/inference/",

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.

Trailing slash in base_url produces double-slash endpoint

The base_url value ends with /. In dynamic_config.py (line 94-95), the get_complete_url method constructs the final endpoint like this:

if not api_base.endswith("/chat/completions"):
    api_base = f"{api_base}/chat/completions"

Because the value ends with / (not /chat/completions), the constructed URL becomes:

https://api.charityengine.services/remotejobs/v2/inference//chat/completions

The double slash // in the path could cause routing issues on strict server implementations, even though most servers normalize it. The same pattern exists in the chutes entry and may work in practice, but it is cleaner to remove the trailing slash to match the majority of providers:

Suggested change
"base_url": "https://api.charityengine.services/remotejobs/v2/inference/",
"base_url": "https://api.charityengine.services/remotejobs/v2/inference",

The corresponding assertion in test_charity_engine_provider_resolution (line 56) would also need updating to match.

"api_key_env": "CHARITY_ENGINE_API_KEY",
"api_base_env": "CHARITY_ENGINE_API_BASE",
"param_mappings": {
"max_completion_tokens": "max_tokens"
}
}
Comment on lines +98 to 104

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.

The PR submission checklist explicitly requires at least one test to be added for new providers (see the contributing guide and other providers like xiaomi_mimo which have a dedicated test file). No test file (e.g., tests/test_litellm/llms/openai_like/test_charity_engine.py) was added in this PR, which means the provider registration, config loading, and provider resolution are untested.

Following the pattern established by test_xiaomi_mimo.py and test_assemblyai_provider.py, a test should at minimum verify:

  1. JSONProviderRegistry.exists("charity_engine") is True
  2. The loaded config has the expected base_url, api_key_env, api_base_env, and param_mappings
  3. Provider resolution routes charity_engine/<model> correctly

Comment on lines +98 to 104

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.

The charity_engine provider is registered in providers.json, but the corresponding CHARITY_ENGINE = "charity_engine" enum entry is missing from LlmProviders in litellm/types/utils.py.

This causes two concrete test failures:

  1. Line 27 of test_charity_engine.py will fail with AttributeError: The test asserts hasattr(LlmProviders, "CHARITY_ENGINE"), which will raise an error because the enum member does not exist.
  2. Line 29 of test_charity_engine.py will fail: The test asserts "charity_engine" in litellm.provider_list, but provider_list is built from list(LlmProviders) in litellm/__init__.py (line 1752), so the provider will be absent.

Every other JSON-backed provider in this pattern added the enum entry — for example XIAOMI_MIMO = "xiaomi_mimo" (line 3212), ASSEMBLYAI = "assemblyai" (line 3179), and SYNTHETIC = "synthetic" (line 3207) in litellm/types/utils.py.

Fix: Add the following line to class LlmProviders in litellm/types/utils.py:

CHARITY_ENGINE = "charity_engine"

}
Loading