feat(providers): add Hugging Face inference provider

This commit is contained in:
Celina Hanouti authored and Xubin Ren committed 2026-04-28 14:55:28 +08:00
1 parent ad4802600e
commit 2b455b1e14
3 files changed
+14

No files matched your search

+12
View File
@@ -120,6 +120,18 @@ PROVIDERS: tuple[ProviderSpec, ...] = (
default_api_base="https://openrouter.ai/api/v1",
supports_prompt_caching=True,
),
# Hugging Face Inference Providers: OpenAI-compatible router for chat models.
ProviderSpec(
name="huggingface",
keywords=("huggingface", "hugging-face"),
env_key="HF_TOKEN",
display_name="Hugging Face",
backend="openai_compat",
is_gateway=True,
detect_by_key_prefix="hf_",
detect_by_base_keyword="huggingface",
default_api_base="https://router.huggingface.co/v1",
),
# AiHubMix: global gateway, OpenAI-compatible interface.
# strip_model_prefix=True: doesn't understand "anthropic/claude-3",
# strips to bare "claude-3".