利用 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
feat(llm): add Y-API provider
jiweiyeah9db984c8befd
diff --git a/app/models/llm_provider.py b/app/models/llm_provider.pyindex d27fcf3d..2ca17a9c 100644--- a/app/models/llm_provider.py+++ b/app/models/llm_provider.py@@ -436,6 +436,14 @@ LLM_PROVIDER_REGISTRY = (default_base_url="https://futureinfra.ai/v1/ai",model_docs_url="https://futureinfra.ai/ai/",),+ LLMProviderSpec(+ "yapi",+ "Y-API",+ api_key_url="https://y-api.bestvirtualgoods.com/app/keys",+ default_model="deepseek/deepseek-v4-flash",+ default_base_url="https://api.y-api.bestvirtualgoods.com/v1",+ model_docs_url="https://y-api.bestvirtualgoods.com/models",+ ),# 本地部署与通用网关LLMProviderSpec("ollama",diff --git a/config.example.toml b/config.example.tomlindex 276d30eb..e2cf103a 100644--- a/config.example.toml+++ b/config.example.toml@@ -287,6 +287,13 @@ futureinfra_api_key = ""futureinfra_base_url = ""futureinfra_model_name = ""+# Y-API, an OpenAI-compatible multi-model gateway (also serves /v1/messages).+# API key: https://y-api.bestvirtualgoods.com/app/keys+# Model list: https://y-api.bestvirtualgoods.com/models+yapi_api_key = ""+yapi_base_url = ""+yapi_model_name = ""+# OpenAI or another OpenAI Chat Completions-compatible provider.# API key: https://platform.openai.com/api-keysopenai_api_key = ""diff --git a/test/services/test_llm.py b/test/services/test_llm.pyindex 4e7ea2d4..500c3677 100644--- a/test/services/test_llm.py+++ b/test/services/test_llm.py@@ -404,6 +404,16 @@ class TestLiteLLMProvider(unittest.TestCase):"https://futureinfra.ai/console/?screen=ai-router",)self.assertEqual(futureinfra.model_docs_url, "https://futureinfra.ai/ai/")+ yapi = get_llm_provider("yapi")+ self.assertEqual(yapi.default_model, "deepseek/deepseek-v4-flash")+ self.assertEqual(yapi.default_base_url, "https://api.y-api.bestvirtualgoods.com/v1")+ self.assertEqual(yapi.adapter, "openai_compatible")+ self.assertTrue(yapi.requires_api_key)+ self.assertEqual(+ yapi.api_key_url,+ "https://y-api.bestvirtualgoods.com/app/keys",+ )+ self.assertEqual(yapi.model_docs_url, "https://y-api.bestvirtualgoods.com/models")pollinations = get_llm_provider("pollinations")self.assertEqual(pollinations.default_model, "openai-fast")self.assertEqual(@@ -465,6 +475,7 @@ class TestLiteLLMProvider(unittest.TestCase):"cheaperinference","requesty","futureinfra",+ "yapi","ollama","claude_code","oneapi",diff --git a/test/services/test_webui_i18n.py b/test/services/test_webui_i18n.pyindex 2c11c523..fc15ccbf 100644--- a/test/services/test_webui_i18n.py+++ b/test/services/test_webui_i18n.py@@ -52,6 +52,7 @@ ENGLISH_FALLBACK_KEYS = frozenset("llm_provider_label.cheaperinference","llm_provider_label.requesty","llm_provider_label.futureinfra",+ "llm_provider_label.yapi","llm_provider_label.shengsuanyun","LoomLoom Poll Retry Pending","LoomLoom Poll Retry Warning",diff --git a/webui/i18n/en.json b/webui/i18n/en.jsonindex aa16a1e9..1cb86230 100644--- a/webui/i18n/en.json+++ b/webui/i18n/en.json@@ -241,6 +241,8 @@"llm_provider_tips.requesty": "##### Requesty Configuration\n- **API Key**: Create an API key at [Requesty]({api_key_url})\n- **Base Url**: Defaults to `{default_base_url}`. Use `https://router.eu.requesty.ai/v1` for the EU endpoint\n- **Model Name**: Defaults to `{default_model}`; see the [model list]({model_docs_url}) for other model IDs in `vendor/model` form\n\nRequesty is an OpenAI-compatible gateway to models from many labs.","llm_provider_label.futureinfra": "FutureInfra","llm_provider_tips.futureinfra": "##### FutureInfra Configuration\n- **API Key**: Sign up and create an API key in the [FutureInfra console]({api_key_url})\n- **Base Url**: Defaults to `{default_base_url}`\n- **Model Name**: Defaults to `{default_model}`; see the [docs]({model_docs_url}) for other model IDs in `provider/model` form\n\nFutureInfra is an OpenAI-compatible gateway to models from many labs.",+ "llm_provider_label.yapi": "Y-API",+ "llm_provider_tips.yapi": "##### Y-API Configuration\n- **API Key**: Create an API key in the [Y-API console]({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 other model IDs in `vendor/model` form\n\nY-API is an OpenAI-compatible gateway: one API key serves models from several labs, and it also exposes an Anthropic-compatible `/v1/messages` endpoint.","API Key": "API Key","Base Url": "Base Url","Account ID": "Account ID",diff --git a/webui/i18n/zh.json b/webui/i18n/zh.jsonindex 5c4c90d3..61b845cc 100644--- a/webui/i18n/zh.json+++ b/webui/i18n/zh.json@@ -241,6 +241,8 @@"llm_provider_tips.requesty": "##### Requesty 配置说明\n- **API Key**: 在 [Requesty]({api_key_url}) 创建 API Key\n- **Base Url**: 默认 `{default_base_url}`;如需使用欧盟节点,可填写 `https://router.eu.requesty.ai/v1`\n- **Model Name**: 默认 `{default_model}`;可在 [模型列表]({model_docs_url}) 查看其它 `vendor/model` 格式的模型 ID\n\nRequesty 是兼容 OpenAI 接口的多模型网关。","llm_provider_label.futureinfra": "FutureInfra","llm_provider_tips.futureinfra": "##### FutureInfra 配置说明\n- **API Key**: 在 [FutureInfra 控制台]({api_key_url}) 注册并创建 API Key\n- **Base Url**: 默认 `{default_base_url}`\n- **Model Name**: 默认 `{default_model}`;可在 [文档]({model_docs_url}) 查看其它 `provider/model` 格式的模型 ID\n\nFutureInfra 是兼容 OpenAI 接口的多模型网关。",+ "llm_provider_label.yapi": "Y-API",+ "llm_provider_tips.yapi": "##### Y-API 配置说明\n- **API Key**: 在 [Y-API 控制台]({api_key_url}) 创建 API Key\n- **Base Url**: 默认 `{default_base_url}`\n- **Model Name**: 默认 `{default_model}`;其它 `vendor/model` 格式的模型 ID 见 [模型列表]({model_docs_url})\n\nY-API 是兼容 OpenAI 接口的多模型网关,一个 API Key 可调用多家厂商的模型,同时提供兼容 Anthropic 的 `/v1/messages` 接口。","API Key": "API Key","Base Url": "Base Url","Account ID": "Account ID",