Explain HF's per-provider BYOK requirement in the Custom Model ID sheet and chat errors
Some Hugging Face backends (e.g. Featherless AI) only route requests if the user has added their own API key for that provider at HF's settings — surfaced by Confab as a bare "not supported by any provider you have enabled" error with no indication why. Enriches that specific error with guidance, and adds the same note to the Custom Model ID entry point. Also converted the alert-based Custom Model ID dialog to a real sheet since SwiftUI alerts can't be resized and it read as cramped.
This commit is contained in:
@@ -1255,7 +1255,7 @@ Don't narrate future actions ("Let me...") - just use the tools.
|
||||
messages.remove(at: index)
|
||||
}
|
||||
Log.api.error("Generation failed: \(error.localizedDescription)")
|
||||
showSystemMessage("❌ \(friendlyErrorMessage(from: error))")
|
||||
showSystemMessage("❌ \(Self.friendlyErrorMessage(from: error))")
|
||||
}
|
||||
|
||||
isGenerating = false
|
||||
@@ -1935,7 +1935,7 @@ Don't narrate future actions ("Let me...") - just use the tools.
|
||||
messages.append(assistantMessage)
|
||||
} else {
|
||||
Log.api.error("Tool generation failed: \(error.localizedDescription)")
|
||||
showSystemMessage("❌ \(friendlyErrorMessage(from: error))")
|
||||
showSystemMessage("❌ \(Self.friendlyErrorMessage(from: error))")
|
||||
}
|
||||
|
||||
isGenerating = false
|
||||
@@ -1976,7 +1976,7 @@ Don't narrate future actions ("Let me...") - just use the tools.
|
||||
|
||||
// MARK: - Error Helpers
|
||||
|
||||
private func friendlyErrorMessage(from error: Error) -> String {
|
||||
nonisolated static func friendlyErrorMessage(from error: Error) -> String {
|
||||
let desc = error.localizedDescription
|
||||
|
||||
// Network connectivity
|
||||
@@ -1997,6 +1997,14 @@ Don't narrate future actions ("Let me...") - just use the tools.
|
||||
if desc.contains("401") || desc.contains("403") || desc.lowercased().contains("unauthorized") || desc.lowercased().contains("invalid.*key") {
|
||||
return "Invalid API key. Update it in Settings (\u{2318},)."
|
||||
}
|
||||
|
||||
// Hugging Face: model exists but no *enabled* provider can serve it — usually means the
|
||||
// provider that hosts it (e.g. Featherless AI) needs the user's own API key on HF's side,
|
||||
// not a Confab-side problem.
|
||||
if desc.lowercased().contains("not supported by any provider you have enabled") {
|
||||
let base = desc.hasPrefix("Unknown error: ") ? String(desc.dropFirst("Unknown error: ".count)) : desc
|
||||
return base + " Some Hugging Face providers (e.g. Featherless AI) require your own API key — add one at huggingface.co/settings/inference-providers, or pick a model hosted by a provider Hugging Face bills directly (Together, Fireworks, Groq, Cerebras, etc.)."
|
||||
}
|
||||
if desc.contains("429") || desc.lowercased().contains("rate limit") {
|
||||
return "Rate limited. Wait a moment and try again."
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user