diff --git a/.env.example b/.env.example index 58f3793..ebd06ba 100644 --- a/.env.example +++ b/.env.example @@ -4,9 +4,15 @@ # ============================================ # OpenRouter Configuration # ============================================ -OPENROUTER_API_KEY=your_openrouter_api_key +OPENROUTER_API_KEY=your_openrouter_key OPENROUTER_BASE_URL=https://openrouter.ai/api/v1 +# ============================================ +# Requesty Configuration (OpenAI-compatible router) +# ============================================ +REQUESTY_API_KEY=your_requesty_key +REQUESTY_BASE_URL=https://router.requesty.ai/v1 + # ============================================ # Native API Configuration (Optional) # ============================================ diff --git a/README.md b/README.md index dc402c1..43cc4a6 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,10 @@ cp .env.example .env OPENROUTER_API_KEY=sk-or-... OPENROUTER_BASE_URL=https://openrouter.ai/api/v1 +# Requesty — OpenAI-compatible router (one key, most models) +REQUESTY_API_KEY=rqsty-sk-... +REQUESTY_BASE_URL=https://router.requesty.ai/v1 + # Native providers (only if you call them directly) OPENAI_API_KEY=sk-... # OPENAI_BASE_URL=https://api.openai.com/v1 # override for OpenAI-compatible gateways @@ -120,7 +124,7 @@ python -m mingli_bench.cli \ --year 2025 --cot --astro --max-workers 8 ``` -`--platform` accepts: `openai`, `openrouter`, `anthropic`, `google`, `deepseek`, `doubao`. +`--platform` accepts: `openai`, `openrouter`, `requesty`, `anthropic`, `google`, `deepseek`, `doubao`. --- diff --git a/mingli_bench/models/factory.py b/mingli_bench/models/factory.py index ec55cf6..7da34c1 100644 --- a/mingli_bench/models/factory.py +++ b/mingli_bench/models/factory.py @@ -16,6 +16,7 @@ _PROVIDER_INSTALL_HINT = { 'openai': 'pip install openai', 'openrouter': 'pip install openai', + 'requesty': 'pip install openai', 'deepseek': 'pip install openai', 'anthropic': 'pip install anthropic', 'google': 'pip install google-generativeai', @@ -35,6 +36,7 @@ class ModelFactory: 'deepseek': ('.deepseek_client', 'DeepSeekClient'), 'doubao': ('.doubao_client', 'DoubaoClient'), 'openrouter': ('.openai_client', 'OpenAIClient'), # OpenAI-compatible API + 'requesty': ('.openai_client', 'OpenAIClient'), # OpenAI-compatible API } @classmethod diff --git a/mingli_bench/utils/config.py b/mingli_bench/utils/config.py index 86a57eb..d98cae8 100644 --- a/mingli_bench/utils/config.py +++ b/mingli_bench/utils/config.py @@ -53,6 +53,14 @@ def load_config(env_file: Optional[str] = None) -> Dict[str, Any]: "max_tokens": default_max_tokens, }, + # Requesty configuration (OpenAI-compatible router) + "requesty": { + "api_key": os.getenv("REQUESTY_API_KEY"), + "base_url": os.getenv("REQUESTY_BASE_URL", "https://router.requesty.ai/v1"), + "temperature": default_temperature, + "max_tokens": default_max_tokens, + }, + # Native OpenAI configuration "openai": { "api_key": os.getenv("OPENAI_API_KEY"),