Skip to content

Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors

chore: improve huggingface provider support (#2322)

backryun1f27c344d466
diff --git a/open-sse/config/audioRegistry.ts b/open-sse/config/audioRegistry.ts
index 197b66aaf2..f4d00aa9d3 100644
--- a/open-sse/config/audioRegistry.ts
+++ b/open-sse/config/audioRegistry.ts
@@ -99,8 +99,8 @@ export const AUDIO_TRANSCRIPTION_PROVIDERS: Record<string, AudioProvider> = {
authHeader: "bearer",
format: "huggingface-asr",
models: [
+ { id: "openai/whisper-large-v3-turbo", name: "Whisper Large v3 Turbo (HF)" },
{ id: "openai/whisper-large-v3", name: "Whisper Large v3 (HF)" },
- { id: "openai/whisper-small", name: "Whisper Small (HF)" },
],
},
@@ -192,8 +192,9 @@ export const AUDIO_SPEECH_PROVIDERS: Record<string, AudioProvider> = {
authHeader: "bearer",
format: "huggingface-tts",
models: [
- { id: "facebook/mms-tts-eng", name: "MMS TTS English" },
- { id: "microsoft/speecht5_tts", name: "SpeechT5 TTS" },
+ { id: "canopylabs/orpheus-3b-0.1-ft", name: "Orpheus 3B" },
+ { id: "ResembleAI/chatterbox", name: "Chatterbox" },
+ { id: "hexgrad/Kokoro-82M", name: "Kokoro TTS" },
],
},
diff --git a/open-sse/config/providerRegistry.ts b/open-sse/config/providerRegistry.ts
index 69a7faee2d..85f82731e2 100644
--- a/open-sse/config/providerRegistry.ts
+++ b/open-sse/config/providerRegistry.ts
@@ -2384,20 +2384,11 @@ export const REGISTRY: Record<string, RegistryEntry> = {
alias: "hf",
format: "openai",
executor: "default",
- // HuggingFace Inference API — OpenAI-compatible endpoint
- // Users must set their provider-specific baseUrl (model endpoint) in providerSpecificData.baseUrl
- // or use a fixed model like: https://router.huggingface.co/ngc/nvidia/llama-3_1-nemotron-51b-instruct
- baseUrl:
- "https://router.huggingface.co/hf-inference/models/meta-llama/Meta-Llama-3.1-70B-Instruct/v1/chat/completions",
+ baseUrl: "https://router.huggingface.co/v1/chat/completions",
+ modelsUrl: "https://router.huggingface.co/v1/models",
authType: "apikey",
authHeader: "bearer",
- models: [
- { id: "meta-llama/Meta-Llama-3.1-70B-Instruct", name: "Llama 3.1 70B Instruct" },
- { id: "meta-llama/Meta-Llama-3.1-8B-Instruct", name: "Llama 3.1 8B Instruct" },
- { id: "Qwen/Qwen2.5-72B-Instruct", name: "Qwen 2.5 72B" },
- { id: "mistralai/Mistral-7B-Instruct-v0.3", name: "Mistral 7B v0.3" },
- { id: "microsoft/Phi-3.5-mini-instruct", name: "Phi-3.5 Mini" },
- ],
+ models: [],
},
synthetic: {
diff --git a/src/app/api/providers/[id]/models/route.ts b/src/app/api/providers/[id]/models/route.ts
index d86c6daaca..06c1a382a2 100755
--- a/src/app/api/providers/[id]/models/route.ts
+++ b/src/app/api/providers/[id]/models/route.ts
@@ -547,6 +547,14 @@ const PROVIDER_MODELS_CONFIG: Record<string, ProviderModelsConfigEntry> = {
},
},
// gemini-cli handled via retrieveUserQuota (see GET handler)
+ huggingface: {
+ url: "https://router.huggingface.co/v1/models",
+ method: "GET",
+ headers: { "Content-Type": "application/json" },
+ authHeader: "Authorization",
+ authPrefix: "Bearer ",
+ parseResponse: (data) => normalizeOpenAiLikeModelsResponse(data, "huggingface"),
+ },
qwen: {
url: "https://dashscope-intl.aliyuncs.com/compatible-mode/v1/models",
method: "GET",