Skip to content

利用 AI 大模型和自动化工作流,根据主题或关键词一键生成高清短视频。Generate HD short videos from a topic or keyword with an automated AI workflow.

feat(llm): add FutureInfra provider

uxidevfee8d7da8cb1
diff --git a/app/models/llm_provider.py b/app/models/llm_provider.py
index f7ce479d..d27fcf3d 100644
--- a/app/models/llm_provider.py
+++ b/app/models/llm_provider.py
@@ -428,6 +428,14 @@ LLM_PROVIDER_REGISTRY = (
default_base_url="https://router.requesty.ai/v1",
model_docs_url="https://www.requesty.ai/models",
),
+ LLMProviderSpec(
+ "futureinfra",
+ "FutureInfra",
+ api_key_url="https://futureinfra.ai/console/?screen=ai-router",
+ default_model="openai/gpt-4o-mini",
+ default_base_url="https://futureinfra.ai/v1/ai",
+ model_docs_url="https://futureinfra.ai/ai/",
+ ),
# 本地部署与通用网关
LLMProviderSpec(
"ollama",
diff --git a/config.example.toml b/config.example.toml
index f0e23457..276d30eb 100644
--- a/config.example.toml
+++ b/config.example.toml
@@ -280,6 +280,13 @@ requesty_api_key = ""
requesty_base_url = ""
requesty_model_name = ""
+# FutureInfra, an OpenAI-compatible multi-model gateway.
+# API key: https://futureinfra.ai/console/?screen=ai-router
+# Model list: https://futureinfra.ai/ai/
+futureinfra_api_key = ""
+futureinfra_base_url = ""
+futureinfra_model_name = ""
+
# OpenAI or another OpenAI Chat Completions-compatible provider.
# API key: https://platform.openai.com/api-keys
openai_api_key = ""
diff --git a/test/services/test_llm.py b/test/services/test_llm.py
index bad8165c..4e7ea2d4 100644
--- a/test/services/test_llm.py
+++ b/test/services/test_llm.py
@@ -394,6 +394,16 @@ class TestLiteLLMProvider(unittest.TestCase):
self.assertTrue(requesty.requires_api_key)
self.assertEqual(requesty.api_key_url, "https://app.requesty.ai/api-keys")
self.assertEqual(requesty.model_docs_url, "https://www.requesty.ai/models")
+ futureinfra = get_llm_provider("futureinfra")
+ self.assertEqual(futureinfra.default_model, "openai/gpt-4o-mini")
+ self.assertEqual(futureinfra.default_base_url, "https://futureinfra.ai/v1/ai")
+ self.assertEqual(futureinfra.adapter, "openai_compatible")
+ self.assertTrue(futureinfra.requires_api_key)
+ self.assertEqual(
+ futureinfra.api_key_url,
+ "https://futureinfra.ai/console/?screen=ai-router",
+ )
+ self.assertEqual(futureinfra.model_docs_url, "https://futureinfra.ai/ai/")
pollinations = get_llm_provider("pollinations")
self.assertEqual(pollinations.default_model, "openai-fast")
self.assertEqual(
@@ -454,6 +464,7 @@ class TestLiteLLMProvider(unittest.TestCase):
"fluxionai",
"cheaperinference",
"requesty",
+ "futureinfra",
"ollama",
"claude_code",
"oneapi",
diff --git a/test/services/test_webui_i18n.py b/test/services/test_webui_i18n.py
index 8b79eb6d..2c11c523 100644
--- a/test/services/test_webui_i18n.py
+++ b/test/services/test_webui_i18n.py
@@ -51,6 +51,7 @@ ENGLISH_FALLBACK_KEYS = frozenset(
"llm_provider_label.fluxionai",
"llm_provider_label.cheaperinference",
"llm_provider_label.requesty",
+ "llm_provider_label.futureinfra",
"llm_provider_label.shengsuanyun",
"LoomLoom Poll Retry Pending",
"LoomLoom Poll Retry Warning",
diff --git a/webui/i18n/en.json b/webui/i18n/en.json
index 99530a24..aa16a1e9 100644
--- a/webui/i18n/en.json
+++ b/webui/i18n/en.json
@@ -239,6 +239,8 @@
"llm_provider_tips.cheaperinference": "##### Cheaper Inference Configuration\n- **API Key**: Sign up and create an API key at [Cheaper Inference]({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 model IDs\n\nCheaper Inference is an OpenAI-compatible gateway to models from many labs. Each model costs 15–60% less than the list price of its lab.",
"llm_provider_label.requesty": "Requesty",
"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.",
"API Key": "API Key",
"Base Url": "Base Url",
"Account ID": "Account ID",
diff --git a/webui/i18n/zh.json b/webui/i18n/zh.json
index ca27d5d8..5c4c90d3 100644
--- a/webui/i18n/zh.json
+++ b/webui/i18n/zh.json
@@ -239,6 +239,8 @@
"llm_provider_tips.cheaperinference": "##### Cheaper Inference 配置说明\n- **API Key**: 在 [Cheaper Inference 官网]({api_key_url}) 注册并创建 API Key\n- **Base Url**: 默认 `{default_base_url}`\n- **Model Name**: 默认 `{default_model}`;可在 [模型列表]({model_docs_url}) 查看所有模型 ID\n\nCheaper Inference 是兼容 OpenAI 接口的多模型网关。每个模型的价格比其厂商官方价格低 15–60%。",
"llm_provider_label.requesty": "Requesty",
"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 接口的多模型网关。",
"API Key": "API Key",
"Base Url": "Base Url",
"Account ID": "Account ID",