利用 AI 大模型和自动化工作流,根据主题或关键词一键生成高清短视频。Generate HD short videos from a topic or keyword with an automated AI workflow.
Python ai-video-generatorcontent-creationffmpeginstagram-reelsllmpythonshort-videosubtitlestext-to-speechtiktokvideo-automationvideo-workflowworkflow-automationyoutube-shorts
fix(llm): update API Route default model to gpt-5.4-mini and link model docs
DennyHo0917729c0fcb4bc1
diff --git a/app/models/llm_provider.py b/app/models/llm_provider.pyindex 857ac9e4..48d831fb 100644--- a/app/models/llm_provider.py+++ b/app/models/llm_provider.py@@ -42,6 +42,7 @@ class LLMProviderSpec:api_key_url: str = ""default_model: str = ""default_base_url: str = ""+ model_docs_url: str = ""requires_api_key: bool = Truerequires_model_name: bool = Truerequires_base_url: bool = True@@ -137,6 +138,13 @@ class LLMProviderSpec:)return endpoint.api_key_url if endpoint else self.api_key_url+ def effective_model_docs_url(self, *, prefer_international: bool = False) -> str:+ """统一解析模型列表与文档入口,避免 Endpoint Provider 重复维护链接。"""+ endpoint = self.preferred_service_endpoint(+ prefer_international=prefer_international+ )+ return endpoint.model_docs_url if endpoint and endpoint.model_docs_url else self.model_docs_url+def find_service_endpoint(self, configured_base_url: str | None) -> LLMProviderEndpoint | None:@@ -386,8 +394,9 @@ LLM_PROVIDER_REGISTRY = ("api_route","API Route",api_key_url="https://www.api-route.com",- default_model="gpt-4o",+ default_model="gpt-5.4-mini",default_base_url="https://www.api-route.com/v1",+ model_docs_url="https://www.api-route.com/pricing",),# 本地部署与通用网关LLMProviderSpec(diff --git a/config.example.toml b/config.example.tomlindex afb90201..5cca1b22 100644--- a/config.example.toml+++ b/config.example.toml@@ -344,6 +344,7 @@ openrouter_model_name = ""# API Route, an OpenAI-compatible multi-model routing platform.# API key: https://www.api-route.com+# Model list: https://www.api-route.com/pricingapi_route_api_key = ""api_route_base_url = ""api_route_model_name = ""diff --git a/test/services/test_llm.py b/test/services/test_llm.pyindex f046d982..e8b01c96 100644--- a/test/services/test_llm.py+++ b/test/services/test_llm.py@@ -316,7 +316,7 @@ class TestLiteLLMProvider(unittest.TestCase):self.assertEqual(openrouter.adapter, "openai_compatible")self.assertTrue(openrouter.requires_api_key)api_route = get_llm_provider("api_route")- self.assertEqual(api_route.default_model, "gpt-4o")+ self.assertEqual(api_route.default_model, "gpt-5.4-mini")self.assertEqual(api_route.default_base_url, "https://www.api-route.com/v1")self.assertEqual(api_route.adapter, "openai_compatible")self.assertTrue(api_route.requires_api_key)@@ -421,8 +421,12 @@ class TestLiteLLMProvider(unittest.TestCase):api_route.api_key_url,"https://www.api-route.com",)- self.assertEqual(api_route.default_model, "gpt-4o")+ self.assertEqual(api_route.default_model, "gpt-5.4-mini")self.assertEqual(api_route.default_base_url, "https://www.api-route.com/v1")+ self.assertEqual(+ api_route.model_docs_url,+ "https://www.api-route.com/pricing",+ )def test_provider_registry_uses_conventional_locale_and_config_keys(self):"""统一命名规则可避免 WebUI 为每个 Provider 增加硬编码映射。"""@@ -489,7 +493,9 @@ class TestLiteLLMProvider(unittest.TestCase):default_model=provider.default_model,default_base_url=provider.effective_default_base_url,model_docs_url=(- default_endpoint.model_docs_url if default_endpoint else ""+ default_endpoint.model_docs_url+ if default_endpoint+ else provider.effective_model_docs_url()),docker_hint="",**{@@ -548,7 +554,9 @@ class TestLiteLLMProvider(unittest.TestCase):default_model=provider.default_model,default_base_url=provider.effective_default_base_url,model_docs_url=(- default_endpoint.model_docs_url if default_endpoint else ""+ default_endpoint.model_docs_url+ if default_endpoint+ else provider.effective_model_docs_url()),docker_hint="",**{@@ -1373,7 +1381,7 @@ class TestLiteLLMProvider(unittest.TestCase):self.assertEqual(fake_completions.kwargs,{- "model": "gpt-4o",+ "model": "gpt-5.4-mini","messages": [{"role": "user", "content": "Say hello"}],},)diff --git a/webui/Main.py b/webui/Main.pyindex 596c822d..db68db0e 100644--- a/webui/Main.py+++ b/webui/Main.py@@ -2092,7 +2092,13 @@ def get_llm_provider_tips(provider_id, **kwargs):if service_endpointelse provider.effective_default_base_url),- "model_docs_url": service_endpoint.model_docs_url if service_endpoint else "",+ "model_docs_url": (+ service_endpoint.model_docs_url+ if service_endpoint and service_endpoint.model_docs_url+ else provider.effective_model_docs_url(+ prefer_international=tips_language == "en"+ )+ ),**{f"default_{field.config_suffix}": field.default_valuefor field in provider.extra_fieldsdiff --git a/webui/i18n/en.json b/webui/i18n/en.jsonindex 8021ca13..30634db0 100644--- a/webui/i18n/en.json+++ b/webui/i18n/en.json@@ -456,7 +456,7 @@"llm_provider_tips.aimlapi": "##### AIML API Configuration\n- **API Key**: create one at [AIML API]({api_key_url})\n- **Base Url**: defaults to `{default_base_url}`\n- **Model Name**: defaults to `{default_model}`; you can also enter another supported model ID","llm_provider_tips.evolink": "##### EvoLink Configuration\n- **API Key**: create one on [EvoLink]({api_key_url})\n- **Base Url**: defaults to `{default_base_url}`\n- **Model Name**: defaults to `{default_model}`; you can also enter another supported model ID","llm_provider_tips.openrouter": "##### OpenRouter Configuration\n- **API Key**: create one in [OpenRouter Keys]({api_key_url})\n- **Base Url**: defaults to `{default_base_url}`\n- **Model Name**: defaults to `{default_model}`; use another model ID from the [free model list](https://openrouter.ai/models?variant=free) if availability changes\n\nRecommended free alternatives for this workflow: `z-ai/glm-5.2:free` or `openrouter/free`. Free endpoints are rate limited and may change availability.",- "llm_provider_tips.api_route": "##### API Route Configuration\n- **API Key**: Register and obtain an API key at [API Route]({api_key_url})\n- **Base Url**: Defaults to `{default_base_url}`\n- **Model Name**: Defaults to `{default_model}`; you can also enter any other model ID supported by the platform (such as claude-3-7-sonnet, deepseek-chat, etc.)\n\nAPI Route provides high-availability multi-model AI routing with standard OpenAI compatibility.",+ "llm_provider_tips.api_route": "##### API Route Configuration\n- **API Key**: Register and obtain an API key at [API Route]({api_key_url})\n- **Base Url**: Defaults to `{default_base_url}`\n- **Model Name**: Defaults to `{default_model}`; see the [model list]({model_docs_url}) for all supported model IDs\n\nAPI Route provides high-availability multi-model AI routing with standard OpenAI compatibility.","llm_provider_tips.volcengine": "##### VolcEngine Ark Configuration\n- **API Key**: create one in the Ark console; [register on VolcEngine]({api_key_url})\n- **Base Url**: defaults to `{default_base_url}`\n- **Model Name**: defaults to `{default_model}`; make sure the model is enabled in your Ark account","llm_provider_tips.moonshot": "##### Kimi / Moonshot Configuration\n- **API Key**: register through the [MoneyPrinterTurbo link (10% bonus API credit on your first top-up)]({api_key_url}) and create one in the console\n- **Base Url**: defaults to `{default_base_url}`\n- **Model Name**: defaults to `{default_model}`; see the [model list]({model_docs_url})\n\nWhy recommended:\n- **Fits the video creation workflow**: helps generate scripts, extract stock-footage search keywords, and improve final footage relevance\n- **Strong long-context capability**: useful for longer topics, batch scripts, and complex prompts\n- **Exclusive offer for new users**: receive bonus API credit equal to 10% of the first successful top-up, up to CNY 1,000; offer ends September 30, 2026","llm_provider_tips.oneapi": "##### OneAPI Configuration\n- **API Key**: create one in your own OneAPI deployment; see the [OneAPI project]({api_key_url})\n- **Base Url**: required; enter the OneAPI service endpoint\n- **Model Name**: required; enter a model ID configured in OneAPI",diff --git a/webui/i18n/zh.json b/webui/i18n/zh.jsonindex 6191ca09..6ea1e175 100644--- a/webui/i18n/zh.json+++ b/webui/i18n/zh.json@@ -456,7 +456,7 @@"llm_provider_tips.aimlapi": "##### AIML API 配置说明\n- **API Key**: 在 [AIML API]({api_key_url}) 创建\n- **Base Url**: 默认 `{default_base_url}`\n- **Model Name**: 默认 `{default_model}`;也可以填写平台支持的其它模型 ID","llm_provider_tips.evolink": "##### EvoLink 配置说明\n- **API Key**: 在 [EvoLink]({api_key_url}) 创建\n- **Base Url**: 默认 `{default_base_url}`\n- **Model Name**: 默认 `{default_model}`;也可以填写平台支持的其它模型 ID","llm_provider_tips.openrouter": "##### OpenRouter 配置说明\n- **API Key**: 在 [OpenRouter Keys]({api_key_url}) 创建\n- **Base Url**: 默认 `{default_base_url}`\n- **Model Name**: 默认 `{default_model}`;如果可用性变化,也可以从 [免费模型列表](https://openrouter.ai/models?variant=free) 填写其它模型 ID\n\n当前工作流推荐的免费替代模型:`z-ai/glm-5.2:free` 或 `openrouter/free`。免费端点有速率限制,可用性可能变化。",- "llm_provider_tips.api_route": "##### API Route 配置说明\n- **API Key**: 在 [API Route 官网]({api_key_url}) 注册并获取 API Key\n- **Base Url**: 默认 `{default_base_url}`\n- **Model Name**: 默认 `{default_model}`;支持填写平台上的其它主流模型(如 claude-3-7-sonnet、deepseek-chat 等)\n\nAPI Route 提供高可用多模型聚合路由服务,兼容 OpenAI 标准接口。",+ "llm_provider_tips.api_route": "##### API Route 配置说明\n- **API Key**: 在 [API Route 官网]({api_key_url}) 注册并获取 API Key\n- **Base Url**: 默认 `{default_base_url}`\n- **Model Name**: 默认 `{default_model}`;可在 [模型列表]({model_docs_url}) 查看所有支持的模型 ID 并按需填写\n\nAPI Route 提供高可用多模型聚合路由服务,兼容 OpenAI 标准接口。","llm_provider_tips.volcengine": "##### VolcEngine Ark 配置说明\n- **API Key**: 在火山引擎方舟控制台创建;[点击注册火山引擎]({api_key_url})\n- **Base Url**: 默认 `{default_base_url}`\n- **Model Name**: 默认 `{default_model}`;请确保已在方舟控制台开通对应模型","llm_provider_tips.moonshot": "##### Kimi / Moonshot 配置说明\n- **API Key**: 通过 [MoneyPrinterTurbo 专属链接(新用户首次充值赠送 10% API 额度)]({api_key_url}) 注册并在控制台创建\n- **Base Url**: 默认 `{default_base_url}`\n- **Model Name**: 默认 `{default_model}`;[查看模型列表]({model_docs_url})\n\n推荐理由:\n- **视频创作链路匹配**: 可用于生成视频文案、提炼素材搜索关键词,并影响最终素材匹配效果\n- **长上下文能力强**: 适合处理较长主题、批量脚本和复杂提示词\n- **新用户专属优惠**: 首次成功充值可获充值金额 10% 的 API 额度,最高赠送 ¥1000,活动截至 2026 年 9 月 30 日","llm_provider_tips.oneapi": "##### OneAPI 配置说明\n- **API Key**: 从您自己的 OneAPI 部署中创建;[查看 OneAPI 项目说明]({api_key_url})\n- **Base Url**: 必填;填写 OneAPI 服务地址\n- **Model Name**: 必填;填写 OneAPI 中已配置的模型 ID",