Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion backend/app/model/model_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@
from pydantic import BeforeValidator

PLATFORM_ALIAS_MAPPING: Final[dict[str, str]] = {
"z.ai": "zhipu",
"z.ai": "openai-compatible-model",
"ModelArk": "openai-compatible-model",
"grok": "openai-compatible-model",
"ernie": "qianfan",
"llama.cpp": "openai-compatible-model",
"deepseek": "openai-compatible-model",
}

# Bedrock Converse requires a region during model initialization.
Expand Down
3 changes: 2 additions & 1 deletion backend/tests/app/model/test_model_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@

def test_normalize_model_platform_maps_known_aliases():
assert normalize_model_platform("grok") == "openai-compatible-model"
assert normalize_model_platform("z.ai") == "zhipu"
assert normalize_model_platform("z.ai") == "openai-compatible-model"
assert normalize_model_platform("ModelArk") == "openai-compatible-model"
assert normalize_model_platform("ernie") == "qianfan"
assert normalize_model_platform("llama.cpp") == "openai-compatible-model"
assert normalize_model_platform("deepseek") == "openai-compatible-model"


def test_normalize_model_platform_keeps_non_alias_unchanged():
Expand Down