Python
feat(providers): add Groq and OpenRouter as first-class resellers
CleverCoder24356cc95027
diff --git a/coworker/providers/matrix.py b/coworker/providers/matrix.pyindex 961cb860..9fdedbfa 100644--- a/coworker/providers/matrix.py+++ b/coworker/providers/matrix.py@@ -442,6 +442,14 @@ MATRIX: dict[str, ModelEntry] = {"nebius:deepseek-ai/DeepSeek-V4-Pro": ModelEntry("DeepSeek V4 Pro · via Nebius", _AGENTIC, 1_048_576),+ # -- Groq (LPU inference) ---------------------------------------------------+ "groq:llama-4-maverick-17b-128e-instruct": ModelEntry(+ "Llama 4 Maverick · via Groq"+ ),+ "groq:deepseek-r1-distill-llama-70b": ModelEntry(+ "DeepSeek R1 Distill 70B · via Groq"+ ),+ "groq:qwen-qwq-32b": ModelEntry("Qwen QwQ 32B · via Groq"),}diff --git a/coworker/providers/registry.py b/coworker/providers/registry.pyindex 42800e5e..aa626eff 100644--- a/coworker/providers/registry.py+++ b/coworker/providers/registry.py@@ -780,6 +780,13 @@ DESCRIPTORS: list[ProviderDescriptor] = [env_key="NVIDIA_API_KEY",endpoint_help="Prefilled with NVIDIA's hosted NIM endpoint. Point it at a self-hosted NIM container (e.g. http://localhost:8000/v1) to use your own deployment.",),+ _compat(+ "groq",+ "Groq",+ base_url="https://api.groq.com/openai/v1",+ recommended_model="llama-4-maverick-17b-128e-instruct",+ env_key="GROQ_API_KEY",+ ),ProviderDescriptor(name="ollama",title="Ollama",diff --git a/tests/test_providers.py b/tests/test_providers.pyindex 8459bd35..e887b1c6 100644--- a/tests/test_providers.py+++ b/tests/test_providers.py@@ -508,6 +508,7 @@ def test_matrix_answers_capabilities_for_reseller_ids():# NIM ids are `vendor/model`, so NVIDIA's own models repeat the word in the# routed id. Deliberate: the `z-ai/` and `deepseek-ai/` rows in matrix.py don't."nvidia:nvidia/nemotron-3-super-120b-a12b",+ "groq:llama-4-maverick-17b-128e-instruct",):caps = capabilities_for(mid)assert caps.tools and caps.parallel_tool_calls and caps.streaming@@ -576,7 +577,7 @@ def test_reseller_descriptors_and_matrix_stay_in_lockstep():for name in ("together", "fireworks", "openrouter", "nebius", "orcarouter", "sambanova",- "novita",+ "novita", "groq",):d = get_descriptor(name)assert d is not None and d.needs_key