Skip to content

DeepTutor: Lifelong Personalized Tutoring. https://deeptutor.info/.

Add Unifically LLM provider

UnificAllyd987908b852e
diff --git a/deeptutor/services/provider_registry.py b/deeptutor/services/provider_registry.py
index da976a8fc..06a385a00 100644
--- a/deeptutor/services/provider_registry.py
+++ b/deeptutor/services/provider_registry.py
@@ -275,6 +275,16 @@ PROVIDERS: tuple[ProviderSpec, ...] = (
detect_by_base_keyword="atlascloud",
default_api_base="https://api.atlascloud.ai/v1",
),
+ ProviderSpec(
+ name="unifically",
+ keywords=("unifically",),
+ env_key="UNIFICALLY_API_KEY",
+ display_name="Unifically",
+ backend="openai_compat",
+ is_gateway=True,
+ detect_by_base_keyword="unifically",
+ default_api_base="https://api.unifically.com/v1",
+ ),
ProviderSpec(
name="volcengine",
keywords=("volcengine", "volces", "ark"),
diff --git a/tests/api/test_settings_router.py b/tests/api/test_settings_router.py
index cc4f09b33..e393b308b 100644
--- a/tests/api/test_settings_router.py
+++ b/tests/api/test_settings_router.py
@@ -615,6 +615,13 @@ def test_llm_provider_choices_include_atlascloud() -> None:
assert llm["atlascloud"]["base_url"] == "https://api.atlascloud.ai/v1"
+def test_llm_provider_choices_include_unifically() -> None:
+ llm = {item["value"]: item for item in settings_router._provider_choices()["llm"]}
+
+ assert llm["unifically"]["label"] == "Unifically"
+ assert llm["unifically"]["base_url"] == "https://api.unifically.com/v1"
+
+
def test_llm_provider_choices_include_novita() -> None:
llm = {item["value"]: item for item in settings_router._provider_choices()["llm"]}
diff --git a/tests/core/test_agentic_client_provider_kwargs.py b/tests/core/test_agentic_client_provider_kwargs.py
index 63a86b82a..19ebf43d0 100644
--- a/tests/core/test_agentic_client_provider_kwargs.py
+++ b/tests/core/test_agentic_client_provider_kwargs.py
@@ -556,6 +556,7 @@ def test_registered_cloud_openai_compat_providers_enable_native_tools() -> None:
"nvidia_nim",
"aihubmix",
"atlascloud",
+ "unifically",
"edenai",
"novita",
"volcengine_coding_plan",
diff --git a/tests/services/config/test_provider_runtime.py b/tests/services/config/test_provider_runtime.py
index c75aeb6ef..9d9572e47 100644
--- a/tests/services/config/test_provider_runtime.py
+++ b/tests/services/config/test_provider_runtime.py
@@ -244,6 +244,57 @@ def test_llm_atlascloud_base_url_detection_preserves_openai_binding_compatibilit
assert resolved.effective_url == "https://api.atlascloud.ai/v1"
+def test_llm_unifically_binding_uses_default_openai_compatible_endpoint() -> None:
+ catalog = _build_catalog(
+ llm_profile={
+ "id": "llm-p",
+ "name": "Unifically",
+ "binding": "unifically",
+ "base_url": "",
+ "api_key": "unifically-key",
+ "api_version": "",
+ "extra_headers": {},
+ "models": [
+ {
+ "id": "llm-m",
+ "name": "Gemini 3.5 Flash",
+ "model": "google/gemini-3.5-flash",
+ }
+ ],
+ }
+ )
+
+ resolved = resolve_llm_runtime_config(catalog=catalog)
+
+ assert resolved.provider_name == "unifically"
+ assert resolved.provider_mode == "gateway"
+ assert resolved.binding == "unifically"
+ assert resolved.model == "google/gemini-3.5-flash"
+ assert resolved.api_key == "unifically-key"
+ assert resolved.effective_url == "https://api.unifically.com/v1"
+
+
+def test_llm_unifically_base_url_detection_preserves_openai_binding_compatibility() -> None:
+ catalog = _build_catalog(
+ llm_profile={
+ "id": "llm-p",
+ "name": "OpenAI Compatible",
+ "binding": "openai",
+ "base_url": "https://api.unifically.com/v1",
+ "api_key": "unifically-key",
+ "api_version": "",
+ "extra_headers": {},
+ "models": [{"id": "llm-m", "name": "Gemini", "model": "google/gemini-3.5-flash"}],
+ }
+ )
+
+ resolved = resolve_llm_runtime_config(catalog=catalog)
+
+ assert resolved.provider_name == "unifically"
+ assert resolved.provider_mode == "gateway"
+ assert resolved.effective_url == "https://api.unifically.com/v1"
+
+
def test_llm_novita_binding_uses_default_openai_compatible_endpoint() -> None:
catalog = _build_catalog(
llm_profile={
diff --git a/tests/services/test_provider_registry.py b/tests/services/test_provider_registry.py
index a32fe9006..ad346b0ff 100644
--- a/tests/services/test_provider_registry.py
+++ b/tests/services/test_provider_registry.py
@@ -53,6 +53,18 @@ def test_novita_provider_aliases_and_base_detection() -> None:
assert find_gateway(api_base="https://api.novita.ai/openai") == spec
+def test_unifically_provider_lookup_and_base_detection() -> None:
+ spec = find_by_name("unifically")
+
+ assert spec is not None
+ assert spec.display_name == "Unifically"
+ assert spec.env_key == "UNIFICALLY_API_KEY"
+ assert spec.backend == "openai_compat"
+ assert spec.mode == "gateway"
+ assert spec.default_api_base == "https://api.unifically.com/v1"
+ assert find_gateway(api_base="https://api.unifically.com/v1") == spec
+
+
def test_openai_codex_is_not_detected_from_api_base() -> None:
assert find_gateway(api_base="https://codex.example.com/v1") is None