From 43fe6afcac74649db21834d66a3e0deaed28989b Mon Sep 17 00:00:00 2001 From: Luis Castillo Date: Sat, 5 Sep 2026 15:26:47 +0200 Subject: [PATCH 1/4] feat(provider): add The Grid as a JSON-configured OpenAI-compatible provider The Grid is a spot market for inference. Instrument ids such as text-standard, code-prime or agent-max name a task type and a quality tier rather than a fixed model, and each request is filled by whichever supplier is competitive at the time, so the model reported in a response differs from the instrument requested. Chat completions and responses are both served, and max_completion_tokens is accepted natively, so the entry carries no param_mappings for it. --- litellm/llms/openai_like/providers.json | 6 + .../provider_endpoints_support_backup.json | 17 ++ model_prices_and_context_window.json | 238 ++++++++++++++++++ provider_endpoints_support.json | 17 ++ .../llms/openai_like/test_thegrid_provider.py | 93 +++++++ 5 files changed, 371 insertions(+) create mode 100644 tests/test_litellm/llms/openai_like/test_thegrid_provider.py diff --git a/litellm/llms/openai_like/providers.json b/litellm/llms/openai_like/providers.json index a458a209ea9..75fc70e4896 100644 --- a/litellm/llms/openai_like/providers.json +++ b/litellm/llms/openai_like/providers.json @@ -200,5 +200,11 @@ "temperature_max": 1.99 }, "supported_endpoints": ["/v1/chat/completions"] + }, + "thegrid": { + "base_url": "https://api.thegrid.ai/v1", + "api_key_env": "THEGRID_API_KEY", + "api_base_env": "THEGRID_API_BASE", + "supported_endpoints": ["/v1/chat/completions", "/v1/responses"] } } diff --git a/litellm/provider_endpoints_support_backup.json b/litellm/provider_endpoints_support_backup.json index 9d6b1e18f59..999a083ef9f 100644 --- a/litellm/provider_endpoints_support_backup.json +++ b/litellm/provider_endpoints_support_backup.json @@ -1097,6 +1097,23 @@ "interactions": true } }, + "thegrid": { + "display_name": "The Grid (`thegrid`)", + "url": "https://docs.litellm.ai/docs/providers/thegrid", + "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 + } + }, "vertex_ai": { "display_name": "Google - Vertex AI (`vertex_ai`)", "url": "https://docs.litellm.ai/docs/providers/vertex", diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json index 2459ed940e0..ec55c5c828a 100644 --- a/model_prices_and_context_window.json +++ b/model_prices_and_context_window.json @@ -63091,5 +63091,243 @@ "supports_tool_choice": false, "supports_response_schema": true, "supports_vision": false + }, + "thegrid/agent-max": { + "max_tokens": 128000, + "max_input_tokens": 922000, + "max_output_tokens": 128000, + "input_cost_per_token": 1.5532e-06, + "output_cost_per_token": 1.5532e-06, + "cache_read_input_token_cost": 1.5532e-06, + "litellm_provider": "thegrid", + "mode": "chat", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_vision": true + }, + "thegrid/agent-prime": { + "max_tokens": 131072, + "max_input_tokens": 120000, + "max_output_tokens": 131072, + "input_cost_per_token": 1.335e-07, + "output_cost_per_token": 1.335e-07, + "cache_read_input_token_cost": 1.335e-07, + "litellm_provider": "thegrid", + "mode": "chat", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_vision": false + }, + "thegrid/agent-standard": { + "max_tokens": 65536, + "max_input_tokens": 120000, + "max_output_tokens": 65536, + "input_cost_per_token": 4.02e-08, + "output_cost_per_token": 4.02e-08, + "cache_read_input_token_cost": 4.02e-08, + "litellm_provider": "thegrid", + "mode": "chat", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_vision": false + }, + "thegrid/bytedance-pro-latest": { + "max_tokens": 131072, + "max_input_tokens": 256000, + "max_output_tokens": 131072, + "input_cost_per_token": 1.91e-07, + "output_cost_per_token": 1.91e-07, + "cache_read_input_token_cost": 1.91e-07, + "litellm_provider": "thegrid", + "mode": "chat", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_vision": false + }, + "thegrid/claude-opus-latest": { + "max_tokens": 128000, + "max_input_tokens": 922000, + "max_output_tokens": 128000, + "input_cost_per_token": 1.5176e-06, + "output_cost_per_token": 1.5176e-06, + "cache_read_input_token_cost": 1.5176e-06, + "litellm_provider": "thegrid", + "mode": "chat", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_vision": true + }, + "thegrid/code-max": { + "max_tokens": 128000, + "max_input_tokens": 922000, + "max_output_tokens": 128000, + "input_cost_per_token": 1.5874999999999998e-06, + "output_cost_per_token": 1.5874999999999998e-06, + "cache_read_input_token_cost": 1.5874999999999998e-06, + "litellm_provider": "thegrid", + "mode": "chat", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_vision": true + }, + "thegrid/code-prime": { + "max_tokens": 131072, + "max_input_tokens": 120000, + "max_output_tokens": 131072, + "input_cost_per_token": 1.3719999999999998e-07, + "output_cost_per_token": 1.3719999999999998e-07, + "cache_read_input_token_cost": 1.3719999999999998e-07, + "litellm_provider": "thegrid", + "mode": "chat", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_vision": false + }, + "thegrid/code-standard": { + "max_tokens": 65536, + "max_input_tokens": 120000, + "max_output_tokens": 65536, + "input_cost_per_token": 2e-08, + "output_cost_per_token": 2e-08, + "cache_read_input_token_cost": 2e-08, + "litellm_provider": "thegrid", + "mode": "chat", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_vision": false + }, + "thegrid/deepseek-pro-latest": { + "max_tokens": 384000, + "max_input_tokens": 922000, + "max_output_tokens": 384000, + "input_cost_per_token": 3.1809999999999997e-07, + "output_cost_per_token": 3.1809999999999997e-07, + "cache_read_input_token_cost": 3.1809999999999997e-07, + "litellm_provider": "thegrid", + "mode": "chat", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_vision": false + }, + "thegrid/gemini-pro-latest": { + "max_tokens": 65536, + "max_input_tokens": 922000, + "max_output_tokens": 65536, + "input_cost_per_token": 5.887e-07, + "output_cost_per_token": 5.887e-07, + "cache_read_input_token_cost": 5.887e-07, + "litellm_provider": "thegrid", + "mode": "chat", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_vision": true + }, + "thegrid/glm-latest": { + "max_tokens": 128000, + "max_input_tokens": 922000, + "max_output_tokens": 128000, + "input_cost_per_token": 3.383e-07, + "output_cost_per_token": 3.383e-07, + "cache_read_input_token_cost": 3.383e-07, + "litellm_provider": "thegrid", + "mode": "chat", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_vision": false + }, + "thegrid/gpt-sol-latest": { + "max_tokens": 128000, + "max_input_tokens": 922000, + "max_output_tokens": 128000, + "input_cost_per_token": 1.4545e-06, + "output_cost_per_token": 1.4545e-06, + "cache_read_input_token_cost": 1.4545e-06, + "litellm_provider": "thegrid", + "mode": "chat", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_vision": true + }, + "thegrid/kimi-latest": { + "max_tokens": 1048576, + "max_input_tokens": 922000, + "max_output_tokens": 1048576, + "input_cost_per_token": 7.163e-07, + "output_cost_per_token": 7.163e-07, + "cache_read_input_token_cost": 7.163e-07, + "litellm_provider": "thegrid", + "mode": "chat", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_vision": true + }, + "thegrid/minimax-latest": { + "max_tokens": 512000, + "max_input_tokens": 922000, + "max_output_tokens": 512000, + "input_cost_per_token": 1.063e-07, + "output_cost_per_token": 1.063e-07, + "cache_read_input_token_cost": 1.063e-07, + "litellm_provider": "thegrid", + "mode": "chat", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_vision": false + }, + "thegrid/text-max": { + "max_tokens": 128000, + "max_input_tokens": 922000, + "max_output_tokens": 128000, + "input_cost_per_token": 1.6147e-06, + "output_cost_per_token": 1.6147e-06, + "cache_read_input_token_cost": 1.6147e-06, + "litellm_provider": "thegrid", + "mode": "chat", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_vision": true + }, + "thegrid/text-prime": { + "max_tokens": 131072, + "max_input_tokens": 120000, + "max_output_tokens": 131072, + "input_cost_per_token": 1.0090000000000001e-07, + "output_cost_per_token": 1.0090000000000001e-07, + "cache_read_input_token_cost": 1.0090000000000001e-07, + "litellm_provider": "thegrid", + "mode": "chat", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_vision": false + }, + "thegrid/text-standard": { + "max_tokens": 65536, + "max_input_tokens": 120000, + "max_output_tokens": 65536, + "input_cost_per_token": 3.02e-08, + "output_cost_per_token": 3.02e-08, + "cache_read_input_token_cost": 3.02e-08, + "litellm_provider": "thegrid", + "mode": "chat", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_vision": false } } diff --git a/provider_endpoints_support.json b/provider_endpoints_support.json index 41ed8e1d975..cb21e477106 100644 --- a/provider_endpoints_support.json +++ b/provider_endpoints_support.json @@ -3033,6 +3033,23 @@ "rerank": false, "a2a": false } + }, + "thegrid": { + "display_name": "The Grid (`thegrid`)", + "url": "https://docs.litellm.ai/docs/providers/thegrid", + "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 + } } }, "endpoints": { diff --git a/tests/test_litellm/llms/openai_like/test_thegrid_provider.py b/tests/test_litellm/llms/openai_like/test_thegrid_provider.py new file mode 100644 index 00000000000..6a8a10dd90e --- /dev/null +++ b/tests/test_litellm/llms/openai_like/test_thegrid_provider.py @@ -0,0 +1,93 @@ +""" +Unit tests for The Grid OpenAI-like provider. +""" + +import json +from pathlib import Path + +import litellm +from litellm.llms.openai_like.dynamic_config import create_config_class +from litellm.llms.openai_like.json_loader import JSONProviderRegistry + +THEGRID_BASE_URL = "https://api.thegrid.ai/v1" + + +def _get_config(): + provider = JSONProviderRegistry.get("thegrid") + assert provider is not None + config_class = create_config_class(provider) + return config_class() + + +def test_thegrid_provider_registered(): + provider = JSONProviderRegistry.get("thegrid") + assert provider is not None + assert provider.base_url == THEGRID_BASE_URL + assert provider.api_key_env == "THEGRID_API_KEY" + assert provider.api_base_env == "THEGRID_API_BASE" + + +def test_thegrid_resolves_env_api_key(monkeypatch): + config = _get_config() + monkeypatch.setenv("THEGRID_API_KEY", "test-key") + api_base, api_key = config._get_openai_compatible_provider_info(None, None) + assert api_base == THEGRID_BASE_URL + assert api_key == "test-key" + + +def test_thegrid_env_api_base_overrides_default(monkeypatch): + config = _get_config() + monkeypatch.setenv("THEGRID_API_KEY", "test-key") + monkeypatch.setenv("THEGRID_API_BASE", "https://proxy.internal/v1") + api_base, _ = config._get_openai_compatible_provider_info(None, None) + assert api_base == "https://proxy.internal/v1" + + +def test_thegrid_keeps_max_completion_tokens(): + """The Grid accepts max_completion_tokens natively, so it is not remapped. + + Unlike providers that only understand the legacy max_tokens field, sending + max_completion_tokens to /v1/chat/completions caps the response, so the + provider entry deliberately carries no param_mappings for it. + """ + config = _get_config() + params = config.map_openai_params( + non_default_params={"max_completion_tokens": 256}, + optional_params={}, + model="thegrid/text-standard", + drop_params=False, + ) + assert params.get("max_completion_tokens") == 256 + + +def test_thegrid_complete_url_appends_endpoint(): + config = _get_config() + url = config.get_complete_url( + api_base=THEGRID_BASE_URL, + api_key="test-key", + model="thegrid/text-standard", + optional_params={}, + litellm_params={}, + stream=False, + ) + assert url == f"{THEGRID_BASE_URL}/chat/completions" + + +def test_thegrid_supports_responses_endpoint(): + provider = JSONProviderRegistry.get("thegrid") + assert provider is not None + assert "/v1/chat/completions" in provider.supported_endpoints + assert "/v1/responses" in provider.supported_endpoints + + +def test_supported_endpoints_matrix(): + """The Grid must appear in the packaged backup that /public/endpoints serves.""" + matrix = json.loads( + (Path(litellm.__file__).parent / "provider_endpoints_support_backup.json").read_text() + ) + + endpoints = matrix["providers"]["thegrid"]["endpoints"] + assert endpoints["chat_completions"] is True + assert endpoints["responses"] is True + assert endpoints["embeddings"] is False + assert endpoints["messages"] is False From 98b29fa5e961a90eba2d3aa3e2b558aa099ec104 Mon Sep 17 00:00:00 2001 From: Luis Castillo Date: Tue, 22 Sep 2026 14:33:43 +0200 Subject: [PATCH 2/4] docs: use the full product name, The Grid AI Display names and prose only. Slugs, env vars, hostnames and code identifiers are unchanged, so nothing about the wire format moves. Co-Authored-By: Claude Opus 5 --- litellm/provider_endpoints_support_backup.json | 2 +- provider_endpoints_support.json | 2 +- .../test_litellm/llms/openai_like/test_thegrid_provider.py | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/litellm/provider_endpoints_support_backup.json b/litellm/provider_endpoints_support_backup.json index 999a083ef9f..3441f1b8956 100644 --- a/litellm/provider_endpoints_support_backup.json +++ b/litellm/provider_endpoints_support_backup.json @@ -1098,7 +1098,7 @@ } }, "thegrid": { - "display_name": "The Grid (`thegrid`)", + "display_name": "The Grid AI (`thegrid`)", "url": "https://docs.litellm.ai/docs/providers/thegrid", "endpoints": { "chat_completions": true, diff --git a/provider_endpoints_support.json b/provider_endpoints_support.json index cb21e477106..bfd9a0d9b4f 100644 --- a/provider_endpoints_support.json +++ b/provider_endpoints_support.json @@ -3035,7 +3035,7 @@ } }, "thegrid": { - "display_name": "The Grid (`thegrid`)", + "display_name": "The Grid AI (`thegrid`)", "url": "https://docs.litellm.ai/docs/providers/thegrid", "endpoints": { "chat_completions": true, diff --git a/tests/test_litellm/llms/openai_like/test_thegrid_provider.py b/tests/test_litellm/llms/openai_like/test_thegrid_provider.py index 6a8a10dd90e..167495cb8b1 100644 --- a/tests/test_litellm/llms/openai_like/test_thegrid_provider.py +++ b/tests/test_litellm/llms/openai_like/test_thegrid_provider.py @@ -1,5 +1,5 @@ """ -Unit tests for The Grid OpenAI-like provider. +Unit tests for The Grid AI OpenAI-like provider. """ import json @@ -44,7 +44,7 @@ def test_thegrid_env_api_base_overrides_default(monkeypatch): def test_thegrid_keeps_max_completion_tokens(): - """The Grid accepts max_completion_tokens natively, so it is not remapped. + """The Grid AI accepts max_completion_tokens natively, so it is not remapped. Unlike providers that only understand the legacy max_tokens field, sending max_completion_tokens to /v1/chat/completions caps the response, so the @@ -81,7 +81,7 @@ def test_thegrid_supports_responses_endpoint(): def test_supported_endpoints_matrix(): - """The Grid must appear in the packaged backup that /public/endpoints serves.""" + """The Grid AI must appear in the packaged backup that /public/endpoints serves.""" matrix = json.loads( (Path(litellm.__file__).parent / "provider_endpoints_support_backup.json").read_text() ) From ba71fb98e6d5b044b624acfb2d657e4c4fc282b9 Mon Sep 17 00:00:00 2001 From: CastilloLuis Date: Wed, 7 Oct 2026 14:00:11 +0200 Subject: [PATCH 3/4] fix(thegrid): restore the provider and pricing entries after the main retarget The PR base branch litellm_internal_staging was deleted upstream and GitHub retargeted this PR to main, which moved the tests directory and added new providers to the same JSON objects. Entries are re-appended as the last key in each file so upstream formatting is untouched and the diff stays additive. Co-Authored-By: Claude Opus 5 --- litellm/llms/openai_like/providers.json | 6 + model_prices_and_context_window.json | 238 ++++++++++++++++++++++++ 2 files changed, 244 insertions(+) diff --git a/litellm/llms/openai_like/providers.json b/litellm/llms/openai_like/providers.json index f3aa7768928..5e8b1d551a5 100644 --- a/litellm/llms/openai_like/providers.json +++ b/litellm/llms/openai_like/providers.json @@ -223,5 +223,11 @@ "base_url": "https://api.reka.ai/v1", "api_key_env": "REKA_API_KEY", "api_base_env": "REKA_API_BASE" + }, + "thegrid": { + "base_url": "https://api.thegrid.ai/v1", + "api_key_env": "THEGRID_API_KEY", + "api_base_env": "THEGRID_API_BASE", + "supported_endpoints": ["/v1/chat/completions", "/v1/responses"] } } diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json index 96a14895b10..10b35465208 100644 --- a/model_prices_and_context_window.json +++ b/model_prices_and_context_window.json @@ -80730,5 +80730,243 @@ "supports_system_messages": true, "supports_tool_choice": true, "supports_vision": true + }, + "thegrid/agent-max": { + "max_tokens": 128000, + "max_input_tokens": 922000, + "max_output_tokens": 128000, + "input_cost_per_token": 1.5532e-06, + "output_cost_per_token": 1.5532e-06, + "cache_read_input_token_cost": 1.5532e-06, + "litellm_provider": "thegrid", + "mode": "chat", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_vision": true + }, + "thegrid/agent-prime": { + "max_tokens": 131072, + "max_input_tokens": 120000, + "max_output_tokens": 131072, + "input_cost_per_token": 1.335e-07, + "output_cost_per_token": 1.335e-07, + "cache_read_input_token_cost": 1.335e-07, + "litellm_provider": "thegrid", + "mode": "chat", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_vision": false + }, + "thegrid/agent-standard": { + "max_tokens": 65536, + "max_input_tokens": 120000, + "max_output_tokens": 65536, + "input_cost_per_token": 4.02e-08, + "output_cost_per_token": 4.02e-08, + "cache_read_input_token_cost": 4.02e-08, + "litellm_provider": "thegrid", + "mode": "chat", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_vision": false + }, + "thegrid/bytedance-pro-latest": { + "max_tokens": 131072, + "max_input_tokens": 256000, + "max_output_tokens": 131072, + "input_cost_per_token": 1.91e-07, + "output_cost_per_token": 1.91e-07, + "cache_read_input_token_cost": 1.91e-07, + "litellm_provider": "thegrid", + "mode": "chat", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_vision": false + }, + "thegrid/claude-opus-latest": { + "max_tokens": 128000, + "max_input_tokens": 922000, + "max_output_tokens": 128000, + "input_cost_per_token": 1.5176e-06, + "output_cost_per_token": 1.5176e-06, + "cache_read_input_token_cost": 1.5176e-06, + "litellm_provider": "thegrid", + "mode": "chat", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_vision": true + }, + "thegrid/code-max": { + "max_tokens": 128000, + "max_input_tokens": 922000, + "max_output_tokens": 128000, + "input_cost_per_token": 1.5874999999999998e-06, + "output_cost_per_token": 1.5874999999999998e-06, + "cache_read_input_token_cost": 1.5874999999999998e-06, + "litellm_provider": "thegrid", + "mode": "chat", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_vision": true + }, + "thegrid/code-prime": { + "max_tokens": 131072, + "max_input_tokens": 120000, + "max_output_tokens": 131072, + "input_cost_per_token": 1.3719999999999998e-07, + "output_cost_per_token": 1.3719999999999998e-07, + "cache_read_input_token_cost": 1.3719999999999998e-07, + "litellm_provider": "thegrid", + "mode": "chat", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_vision": false + }, + "thegrid/code-standard": { + "max_tokens": 65536, + "max_input_tokens": 120000, + "max_output_tokens": 65536, + "input_cost_per_token": 2e-08, + "output_cost_per_token": 2e-08, + "cache_read_input_token_cost": 2e-08, + "litellm_provider": "thegrid", + "mode": "chat", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_vision": false + }, + "thegrid/deepseek-pro-latest": { + "max_tokens": 384000, + "max_input_tokens": 922000, + "max_output_tokens": 384000, + "input_cost_per_token": 3.1809999999999997e-07, + "output_cost_per_token": 3.1809999999999997e-07, + "cache_read_input_token_cost": 3.1809999999999997e-07, + "litellm_provider": "thegrid", + "mode": "chat", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_vision": false + }, + "thegrid/gemini-pro-latest": { + "max_tokens": 65536, + "max_input_tokens": 922000, + "max_output_tokens": 65536, + "input_cost_per_token": 5.887e-07, + "output_cost_per_token": 5.887e-07, + "cache_read_input_token_cost": 5.887e-07, + "litellm_provider": "thegrid", + "mode": "chat", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_vision": true + }, + "thegrid/glm-latest": { + "max_tokens": 128000, + "max_input_tokens": 922000, + "max_output_tokens": 128000, + "input_cost_per_token": 3.383e-07, + "output_cost_per_token": 3.383e-07, + "cache_read_input_token_cost": 3.383e-07, + "litellm_provider": "thegrid", + "mode": "chat", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_vision": false + }, + "thegrid/gpt-sol-latest": { + "max_tokens": 128000, + "max_input_tokens": 922000, + "max_output_tokens": 128000, + "input_cost_per_token": 1.4545e-06, + "output_cost_per_token": 1.4545e-06, + "cache_read_input_token_cost": 1.4545e-06, + "litellm_provider": "thegrid", + "mode": "chat", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_vision": true + }, + "thegrid/kimi-latest": { + "max_tokens": 1048576, + "max_input_tokens": 922000, + "max_output_tokens": 1048576, + "input_cost_per_token": 7.163e-07, + "output_cost_per_token": 7.163e-07, + "cache_read_input_token_cost": 7.163e-07, + "litellm_provider": "thegrid", + "mode": "chat", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_vision": true + }, + "thegrid/minimax-latest": { + "max_tokens": 512000, + "max_input_tokens": 922000, + "max_output_tokens": 512000, + "input_cost_per_token": 1.063e-07, + "output_cost_per_token": 1.063e-07, + "cache_read_input_token_cost": 1.063e-07, + "litellm_provider": "thegrid", + "mode": "chat", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_vision": false + }, + "thegrid/text-max": { + "max_tokens": 128000, + "max_input_tokens": 922000, + "max_output_tokens": 128000, + "input_cost_per_token": 1.6147e-06, + "output_cost_per_token": 1.6147e-06, + "cache_read_input_token_cost": 1.6147e-06, + "litellm_provider": "thegrid", + "mode": "chat", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_vision": true + }, + "thegrid/text-prime": { + "max_tokens": 131072, + "max_input_tokens": 120000, + "max_output_tokens": 131072, + "input_cost_per_token": 1.0090000000000001e-07, + "output_cost_per_token": 1.0090000000000001e-07, + "cache_read_input_token_cost": 1.0090000000000001e-07, + "litellm_provider": "thegrid", + "mode": "chat", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_vision": false + }, + "thegrid/text-standard": { + "max_tokens": 65536, + "max_input_tokens": 120000, + "max_output_tokens": 65536, + "input_cost_per_token": 3.02e-08, + "output_cost_per_token": 3.02e-08, + "cache_read_input_token_cost": 3.02e-08, + "litellm_provider": "thegrid", + "mode": "chat", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_vision": false } } From 30da889c0a1c23860fb0f7f7f1b1afc3158cd7ec Mon Sep 17 00:00:00 2001 From: CastilloLuis Date: Thu, 5 Nov 2026 11:01:25 +0100 Subject: [PATCH 4/4] Regenerate provider endpoint support with the updated generator The generator now derives messages, interactions and other bridged flags from chat completions, so the test no longer pins messages to false. --- .../provider_endpoints_support_backup.json | 43 +++++++++++-------- provider_endpoints_support.json | 17 ++++++-- .../llms/openai_like/test_thegrid_provider.py | 1 - 3 files changed, 39 insertions(+), 22 deletions(-) diff --git a/litellm/provider_endpoints_support_backup.json b/litellm/provider_endpoints_support_backup.json index dd669e9412a..ccba2a09951 100644 --- a/litellm/provider_endpoints_support_backup.json +++ b/litellm/provider_endpoints_support_backup.json @@ -1946,23 +1946,6 @@ "generateContent": true } }, - "thegrid": { - "display_name": "The Grid AI (`thegrid`)", - "url": "https://docs.litellm.ai/docs/providers/thegrid", - "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 - } - }, "vertex_ai": { "display_name": "Google - Vertex AI (`vertex_ai`)", "url": "https://docs.litellm.ai/docs/providers/vertex", @@ -5526,6 +5509,32 @@ "a2a": true, "generateContent": true } + }, + "thegrid": { + "display_name": "The Grid AI (`thegrid`)", + "url": "https://docs.litellm.ai/docs/providers/thegrid", + "endpoints": { + "chat_completions": true, + "responses": true, + "text_completion": true, + "embeddings": false, + "image_generations": false, + "image_edits": false, + "audio_transcriptions": false, + "audio_speech": false, + "rerank": false, + "ocr": false, + "search": false, + "moderations": false, + "realtime": false, + "video_generations": false, + "batches": false, + "messages": true, + "interactions": true, + "systemone": false, + "a2a": true, + "generateContent": true + } } }, "endpoints": { diff --git a/provider_endpoints_support.json b/provider_endpoints_support.json index 32012b9183d..ccba2a09951 100644 --- a/provider_endpoints_support.json +++ b/provider_endpoints_support.json @@ -5515,16 +5515,25 @@ "url": "https://docs.litellm.ai/docs/providers/thegrid", "endpoints": { "chat_completions": true, - "messages": false, "responses": true, + "text_completion": true, "embeddings": false, "image_generations": false, + "image_edits": false, "audio_transcriptions": false, "audio_speech": false, - "moderations": false, - "batches": false, "rerank": false, - "a2a": false + "ocr": false, + "search": false, + "moderations": false, + "realtime": false, + "video_generations": false, + "batches": false, + "messages": true, + "interactions": true, + "systemone": false, + "a2a": true, + "generateContent": true } } }, diff --git a/tests/unit/llms/openai_like/test_thegrid_provider.py b/tests/unit/llms/openai_like/test_thegrid_provider.py index 167495cb8b1..1135097fd0b 100644 --- a/tests/unit/llms/openai_like/test_thegrid_provider.py +++ b/tests/unit/llms/openai_like/test_thegrid_provider.py @@ -90,4 +90,3 @@ def test_supported_endpoints_matrix(): assert endpoints["chat_completions"] is True assert endpoints["responses"] is True assert endpoints["embeddings"] is False - assert endpoints["messages"] is False