Add Hugging Face as a chat provider

Lets users with an existing Hugging Face account chat through HF's
Inference Providers router without signing up for another provider.
Model IDs are namespaced hf:org/model-name to avoid inferProvider's
OpenRouter "/" heuristic misrouting them; curated model list plus a
"Custom Model ID…" entry point stand in for HF's lack of a catalog/
pricing API.
This commit is contained in:
2026-08-28 07:54:22 +02:00
parent 017a0dbd9d
commit 0035340f2e
14 changed files with 624 additions and 4 deletions
+3
View File
@@ -57,10 +57,12 @@ struct Settings: Codable {
case openai
case ollama
case appleOnDevice = "apple_on_device"
case huggingface
var displayName: String {
switch self {
case .appleOnDevice: return "Apple Intelligence"
case .huggingface: return "Hugging Face"
default: return rawValue.capitalized
}
}
@@ -72,6 +74,7 @@ struct Settings: Codable {
case .openai: return "sparkles"
case .ollama: return "server.rack"
case .appleOnDevice: return "apple.logo"
case .huggingface: return "face.smiling"
}
}
}