The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
feat(charity_engine): add Charity Engine provider (#23223)
tristanolive30b82c3a0cef
diff --git a/litellm/llms/openai_like/providers.json b/litellm/llms/openai_like/providers.jsonindex b3125d4ad38..275c352b39e 100644--- a/litellm/llms/openai_like/providers.json+++ b/litellm/llms/openai_like/providers.json@@ -94,5 +94,12 @@"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",+ "api_key_env": "CHARITY_ENGINE_API_KEY",+ "param_mappings": {+ "max_completion_tokens": "max_tokens"+ }}}diff --git a/litellm/types/utils.py b/litellm/types/utils.pyindex 8ae0cf28925..b5d5c06924d 100644--- a/litellm/types/utils.py+++ b/litellm/types/utils.py@@ -3177,6 +3177,7 @@ class LlmProviders(str, Enum):TOPAZ = "topaz"SAP_GENERATIVE_AI_HUB = "sap"ASSEMBLYAI = "assemblyai"+ CHARITY_ENGINE = "charity_engine"GITHUB_COPILOT = "github_copilot"SNOWFLAKE = "snowflake"GRADIENT_AI = "gradient_ai"diff --git a/tests/test_litellm/llms/openai_like/test_charity_engine.py b/tests/test_litellm/llms/openai_like/test_charity_engine.pynew file mode 100644index 00000000000..5d6a751b624--- /dev/null+++ b/tests/test_litellm/llms/openai_like/test_charity_engine.py@@ -0,0 +1,101 @@+"""+Tests for Charity Engine provider configuration and integration.+"""++import os+import sys++try:+ import pytest+except ImportError:+ pytest = None++# Add workspace to path+workspace_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../../.."))+sys.path.insert(0, workspace_path)++import litellm+++class TestCharityEngineProviderConfig:+ """Test Charity Engine provider configuration"""++ def test_charity_engine_in_provider_list(self):+ """Test that charity_engine is in the provider list"""+ from litellm import LlmProviders++ assert hasattr(LlmProviders, "CHARITY_ENGINE")+ assert LlmProviders.CHARITY_ENGINE.value == "charity_engine"+ assert "charity_engine" in litellm.provider_list++ def test_charity_engine_json_config_exists(self):+ """Test that charity_engine is configured in providers.json"""+ from litellm.llms.openai_like.json_loader import JSONProviderRegistry++ assert JSONProviderRegistry.exists("charity_engine")++ charity_engine = JSONProviderRegistry.get("charity_engine")+ assert charity_engine is not None+ assert charity_engine.base_url == "https://api.charityengine.services/remotejobs/v2/inference"+ assert charity_engine.api_key_env == "CHARITY_ENGINE_API_KEY"+ assert charity_engine.param_mappings.get("max_completion_tokens") == "max_tokens"++ def test_charity_engine_provider_resolution(self):+ """Test that provider resolution finds charity_engine"""+ from litellm.litellm_core_utils.get_llm_provider_logic import get_llm_provider++ model, provider, api_key, api_base = get_llm_provider(+ model="charity_engine/gemma3:270m",+ custom_llm_provider=None,+ api_base=None,+ api_key=None,+ )++ assert model == "gemma3:270m"+ assert provider == "charity_engine"+ assert api_base == "https://api.charityengine.services/remotejobs/v2/inference"++ def test_charity_engine_router_config(self):+ """Test that charity_engine can be used in Router configuration"""+ from litellm import Router++ router = Router(+ model_list=[+ {+ "model_name": "gemma3-270m",+ "litellm_params": {+ "model": "charity_engine/gemma3:270m",+ "api_key": "test-key",+ },+ }+ ]+ )++ assert len(router.model_list) == 1+ assert router.model_list[0]["model_name"] == "gemma3-270m"+++if __name__ == "__main__":+ print("Testing Charity Engine Provider...")++ test_config = TestCharityEngineProviderConfig()++ print("\n1. Testing provider in list...")+ test_config.test_charity_engine_in_provider_list()+ print(" ✓ charity_engine in provider list")++ print("\n2. Testing JSON config...")+ test_config.test_charity_engine_json_config_exists()+ print(" ✓ charity_engine JSON config loaded")++ print("\n3. Testing provider resolution...")+ test_config.test_charity_engine_provider_resolution()+ print(" ✓ Provider resolution works")++ print("\n4. Testing router configuration...")+ test_config.test_charity_engine_router_config()+ print(" ✓ Router configuration works")++ print("\n" + "=" * 50)+ print("✓ All configuration tests passed!")+ print("=" * 50)