Spaces:
Running
Running
File size: 1,187 Bytes
1635e66 1f70507 1635e66 1f70507 1635e66 | 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 34 35 | """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_K26_MODEL_ID = "moonshotai/Kimi-K2.6:novita"
KIMI_K27_CODE_MODEL_ID = "moonshotai/Kimi-K2.7-Code"
MINIMAX_M27_MODEL_ID = "MiniMaxAI/MiniMax-M2.7:novita"
GLM_51_MODEL_ID = "zai-org/GLM-5.1: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_K26_MODEL_ID,
KIMI_K27_CODE_MODEL_ID,
MINIMAX_M27_MODEL_ID,
GLM_51_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)
|