From ed58ab7eef86703197d9102f239be807c644db23 Mon Sep 17 00:00:00 2001 From: aimanmalib <84276911+aimanmalib@users.noreply.github.com> Date: Sat, 6 Jun 2026 17:11:09 +0000 Subject: [PATCH] feat: add Groq, DeepSeek, Together, and Mistral provider presets All four are OpenAI-compatible bearer-auth endpoints (verified reachable). Adds presets + config-resolution tests (+4) and documents them in the Supported Providers table. 116 tests pass. --- README.md | 4 ++++ src/contentforge/core/config.py | 28 ++++++++++++++++++++++++++++ tests/unit/test_llm_config.py | 33 ++++++++++++++++++++++++++++++++- 3 files changed, 64 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ed53693..a0d462e 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,10 @@ ContentForge talks to any OpenAI-compatible `/chat/completions` endpoint. Built- | OpenAI | `openai` | `gpt-4o-mini` | Bearer | `OPENAI_API_KEY`, `OPENAI_BASE_URL` | | OpenRouter | `openrouter` | `openai/gpt-4o-mini` | Bearer | `OPENROUTER_API_KEY` | | Ollama (local) | `ollama` | `llama3.1` | Bearer | `OLLAMA_BASE_URL` | +| Groq | `groq` | `llama-3.3-70b-versatile` | Bearer | `GROQ_API_KEY` | +| DeepSeek | `deepseek` | `deepseek-chat` | Bearer | `DEEPSEEK_API_KEY` | +| Together | `together` | `meta-llama/Llama-3.3-70B-Instruct-Turbo` | Bearer | `TOGETHER_API_KEY` | +| Mistral | `mistral` | `mistral-small-latest` | Bearer | `MISTRAL_API_KEY` | | Xiaomi MiMo | `mimo` | `mimo-v2.5-pro` | api-key | `MIMO_API_KEY` | Point `base_url` at any other compatible endpoint (llama.cpp, vLLM, LM Studio, a local proxy) and it just works. The pipeline benefits from models that expose a `reasoning_content` field (used by the Quality Agent's 8-dimension scoring) and strong multilingual output (used by the Translator Agent), but neither is required. diff --git a/src/contentforge/core/config.py b/src/contentforge/core/config.py index 55cf236..7b8d2c0 100644 --- a/src/contentforge/core/config.py +++ b/src/contentforge/core/config.py @@ -47,6 +47,34 @@ "env_key": "OLLAMA_API_KEY", "env_base": "OLLAMA_BASE_URL", }, + "groq": { + "base_url": "https://api.groq.com/openai/v1", + "auth_style": "bearer", + "model": "llama-3.3-70b-versatile", + "env_key": "GROQ_API_KEY", + "env_base": "GROQ_BASE_URL", + }, + "deepseek": { + "base_url": "https://api.deepseek.com/v1", + "auth_style": "bearer", + "model": "deepseek-chat", + "env_key": "DEEPSEEK_API_KEY", + "env_base": "DEEPSEEK_BASE_URL", + }, + "together": { + "base_url": "https://api.together.xyz/v1", + "auth_style": "bearer", + "model": "meta-llama/Llama-3.3-70B-Instruct-Turbo", + "env_key": "TOGETHER_API_KEY", + "env_base": "TOGETHER_BASE_URL", + }, + "mistral": { + "base_url": "https://api.mistral.ai/v1", + "auth_style": "bearer", + "model": "mistral-small-latest", + "env_key": "MISTRAL_API_KEY", + "env_base": "MISTRAL_BASE_URL", + }, } DEFAULT_PROVIDER = "mimo" diff --git a/tests/unit/test_llm_config.py b/tests/unit/test_llm_config.py index a93da31..b2069bf 100644 --- a/tests/unit/test_llm_config.py +++ b/tests/unit/test_llm_config.py @@ -15,7 +15,16 @@ class TestProviderPresets: def test_known_providers_present(self): - for provider in ("mimo", "openai", "openrouter", "ollama"): + for provider in ( + "mimo", + "openai", + "openrouter", + "ollama", + "groq", + "deepseek", + "together", + "mistral", + ): assert provider in PROVIDER_PRESETS def test_default_provider_is_mimo(self): @@ -43,6 +52,28 @@ def test_unknown_provider_falls_back_to_default(self): config = LLMConfig(provider="does-not-exist", api_key="x") assert "xiaomimimo.com" in config.base_url # mimo default + def test_groq_preset(self): + config = LLMConfig(provider="groq", api_key="gsk-test") + assert "api.groq.com" in config.base_url + assert config.auth_style == "bearer" + assert config.model == "llama-3.3-70b-versatile" + + def test_deepseek_preset(self): + config = LLMConfig(provider="deepseek", api_key="sk-test") + assert "api.deepseek.com" in config.base_url + assert config.auth_style == "bearer" + assert config.model == "deepseek-chat" + + def test_together_preset(self): + config = LLMConfig(provider="together", api_key="tg-test") + assert "api.together.xyz" in config.base_url + assert config.auth_style == "bearer" + + def test_mistral_preset(self): + config = LLMConfig(provider="mistral", api_key="ms-test") + assert "api.mistral.ai" in config.base_url + assert config.auth_style == "bearer" + def test_explicit_values_override_preset(self): config = LLMConfig( provider="openai",