File size: 1,117 Bytes
437a804
 
 
 
b103510
437a804
 
433a22b
 
 
42cc639
437a804
ded9881
b103510
 
433a22b
 
 
437a804
 
 
 
 
 
 
 
 
 
 
 
 
ded9881
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"""Canonical model ids for HF Router inference."""

HF_ROUTER_BASE_URL = "https://router.huggingface.co/v1"

# Keep these as verbatim HF Router ids; version punctuation differs by model.
CLAUDE_OPUS_48_MODEL_ID = "anthropic/claude-opus-4.8:fal-ai"
GPT_55_MODEL_ID = "openai/gpt-5.5:fal-ai"
KIMI_K27_CODE_MODEL_ID = "moonshotai/Kimi-K2.7-Code:novita"
MINIMAX_M3_MODEL_ID = "MiniMaxAI/MiniMax-M3:novita"
GLM_52_MODEL_ID = "zai-org/GLM-5.2:novita"
DEEPSEEK_V4_PRO_MODEL_ID = "deepseek-ai/DeepSeek-V4-Pro:novita"

HOSTED_MODEL_IDS = {
    CLAUDE_OPUS_48_MODEL_ID,
    GPT_55_MODEL_ID,
    KIMI_K27_CODE_MODEL_ID,
    MINIMAX_M3_MODEL_ID,
    GLM_52_MODEL_ID,
    DEEPSEEK_V4_PRO_MODEL_ID,
}


def strip_huggingface_model_prefix(model_id: str | None) -> str | None:
    """Return model ids without LiteLLM's optional ``huggingface/`` prefix."""
    if not model_id:
        return model_id
    return model_id.removeprefix("huggingface/")


def is_known_router_model_id(model_id: str | None) -> bool:
    normalized = strip_huggingface_model_prefix(model_id)
    return bool(normalized and normalized in HOSTED_MODEL_IDS)