From c8a4ccaffbca4084c0520c4c56efe4d5f3fc23fe Mon Sep 17 00:00:00 2001 From: halfaipg Date: Fri, 28 Aug 2026 21:22:33 -0400 Subject: [PATCH] fix(provider): document AIPG endpoint support --- litellm/constants.py | 2 +- .../provider_endpoints_support_backup.json | 18 ++++++++ provider_endpoints_support.json | 18 ++++++++ tests/llm_translation/test_aipg.py | 41 +++++++------------ 4 files changed, 51 insertions(+), 28 deletions(-) diff --git a/litellm/constants.py b/litellm/constants.py index 5c235910c1a..c3b99921893 100644 --- a/litellm/constants.py +++ b/litellm/constants.py @@ -809,7 +809,7 @@ openai_compatible_endpoints: Final[list] = [ openai_compatible_providers: Final[list] = [ - "aipg", # AI Power Grid - JSON-configured provider + "aipg", "anyscale", "groq", "nvidia_nim", diff --git a/litellm/provider_endpoints_support_backup.json b/litellm/provider_endpoints_support_backup.json index 86c14fb4cd8..62dec9d4ac9 100644 --- a/litellm/provider_endpoints_support_backup.json +++ b/litellm/provider_endpoints_support_backup.json @@ -84,6 +84,24 @@ "interactions": true } }, + "aipg": { + "display_name": "AI Power Grid (`aipg`)", + "url": "https://docs.litellm.ai/docs/providers/aipg", + "endpoints": { + "chat_completions": true, + "messages": false, + "responses": true, + "embeddings": false, + "image_generations": false, + "audio_transcriptions": false, + "audio_speech": false, + "moderations": false, + "batches": false, + "rerank": false, + "a2a": false, + "interactions": false + } + }, "ai21": { "display_name": "AI21 (`ai21`)", "url": "https://docs.litellm.ai/docs/providers/ai21", diff --git a/provider_endpoints_support.json b/provider_endpoints_support.json index 1d8d374c2c4..251c676975a 100644 --- a/provider_endpoints_support.json +++ b/provider_endpoints_support.json @@ -84,6 +84,24 @@ "interactions": true } }, + "aipg": { + "display_name": "AI Power Grid (`aipg`)", + "url": "https://docs.litellm.ai/docs/providers/aipg", + "endpoints": { + "chat_completions": true, + "messages": false, + "responses": true, + "embeddings": false, + "image_generations": false, + "audio_transcriptions": false, + "audio_speech": false, + "moderations": false, + "batches": false, + "rerank": false, + "a2a": false, + "interactions": false + } + }, "ai21": { "display_name": "AI21 (`ai21`)", "url": "https://docs.litellm.ai/docs/providers/ai21", diff --git a/tests/llm_translation/test_aipg.py b/tests/llm_translation/test_aipg.py index 8054e9fb8bc..075284aebfd 100644 --- a/tests/llm_translation/test_aipg.py +++ b/tests/llm_translation/test_aipg.py @@ -41,9 +41,7 @@ def test_aipg_get_openai_compatible_provider_info(): }, clear=True, ): - api_base, api_key = config._get_openai_compatible_provider_info( - "https://explicit.example/v1", "explicit-key" - ) + api_base, api_key = config._get_openai_compatible_provider_info("https://explicit.example/v1", "explicit-key") assert api_base == "https://explicit.example/v1" assert api_key == "explicit-key" @@ -70,27 +68,16 @@ def test_get_llm_provider_aipg(): def test_aipg_model_metadata(): - original_model_cost = litellm.model_cost - original_env = os.environ.get("LITELLM_LOCAL_MODEL_COST_MAP") - try: - os.environ["LITELLM_LOCAL_MODEL_COST_MAP"] = "True" - litellm.model_cost = litellm.get_model_cost_map(url="") - - expected = { - "aipg/gpt-oss-120b": (60000, 7.5e-08, 3e-07), - "aipg/deepseek-v4-flash-nvfp4": (262144, 7e-08, 1.4e-07), - "aipg/Smollm-135m": (2048, 5e-09, 1e-08), - } - for model, (context, input_cost, output_cost) in expected.items(): - info = litellm.get_model_info(model) - assert info["litellm_provider"] == "aipg" - assert info["mode"] == "chat" - assert info["max_input_tokens"] == context - assert info["input_cost_per_token"] == input_cost - assert info["output_cost_per_token"] == output_cost - finally: - litellm.model_cost = original_model_cost - if original_env is None: - os.environ.pop("LITELLM_LOCAL_MODEL_COST_MAP", None) - else: - os.environ["LITELLM_LOCAL_MODEL_COST_MAP"] = original_env + model_cost = litellm.get_model_cost_map(url="") + expected = { + "aipg/gpt-oss-120b": (60000, 7.5e-08, 3e-07), + "aipg/deepseek-v4-flash-nvfp4": (262144, 7e-08, 1.4e-07), + "aipg/Smollm-135m": (2048, 5e-09, 1e-08), + } + for model, (context, input_cost, output_cost) in expected.items(): + info = model_cost[model] + assert info["litellm_provider"] == "aipg" + assert info["mode"] == "chat" + assert info["max_input_tokens"] == context + assert info["input_cost_per_token"] == input_cost + assert info["output_cost_per_token"] == output_cost