jamiepine/voicebox · error · Error

Failed to fetch model info: ${response.status}

Error message

Failed to fetch model info: ${response.status}

What it means

Thrown by fetchHuggingFaceModelInfo() when the Hugging Face public API (huggingface.co/api/models/<repoId>) returns non-2xx. The returned JSON feeds the model-management UI (description, files, download size). It is an unauthenticated client-side fetch, so it inherits HF's rate limits.

Source

Thrown at app/src/components/ServerSettings/ModelManagement.tsx:51

import { Button } from '@/components/ui/button';
import {
  Dialog,
  DialogContent,
  DialogDescription,
  DialogHeader,
  DialogTitle,
} from '@/components/ui/dialog';
import { Progress } from '@/components/ui/progress';
import { useToast } from '@/components/ui/use-toast';
import { apiClient } from '@/lib/api/client';
import type { ActiveDownloadTask, HuggingFaceModelInfo, ModelStatus } from '@/lib/api/types';
import { useModelDownloadToast } from '@/lib/hooks/useModelDownloadToast';
import { usePlatform } from '@/platform/PlatformContext';
import { useServerStore } from '@/stores/serverStore';

async function fetchHuggingFaceModelInfo(repoId: string): Promise<HuggingFaceModelInfo> {
  const response = await fetch(`https://huggingface.co/api/models/${repoId}`);
  if (!response.ok) throw new Error(`Failed to fetch model info: ${response.status}`);
  return response.json();
}

const MODEL_DESCRIPTIONS: Record<string, string> = {
  'qwen-tts-1.7B':
    'High-quality multilingual TTS by Alibaba. Supports 10 languages with natural prosody and voice cloning from short reference audio.',
  'qwen-tts-0.6B':
    'Lightweight version of Qwen TTS. Same language support with faster inference, ideal for lower-end hardware.',
  luxtts:
    'Lightweight ZipVoice-based TTS designed for high quality voice cloning and 48kHz speech generation at speeds exceeding 150x realtime.',
  'chatterbox-tts':
    'Production-grade open source TTS by Resemble AI. Supports 23 languages with voice cloning and emotion exaggeration control.',
  'chatterbox-turbo':
    'Streamlined 350M parameter TTS by Resemble AI. High-quality English speech with less compute and VRAM than larger models.',
  'tada-1b':
    'HumeAI TADA 1B — English speech-language model built on Llama 3.2 1B. Generates 700s+ of coherent audio with synchronized text-acoustic alignment.',
  'tada-3b-ml':
    'HumeAI TADA 3B Multilingual — built on Llama 3.2 3B. Supports 10 languages with high-fidelity voice cloning via text-acoustic dual alignment.',

View on GitHub (pinned to 51f49dea19)

Solutions

  1. Verify the repoId string matches an existing public HF repo (check the URL in a browser).
  2. Add a retry with backoff for 429 and 5xx responses.
  3. Fall back to the static MODEL_DESCRIPTIONS entry when the live fetch fails.
  4. For gated models, route the request through an authenticated server-side proxy.

Example fix

// before
const response = await fetch(`https://huggingface.co/api/models/${repoId}`);
if (!response.ok) throw new Error(`Failed to fetch model info: ${response.status}`);
// after
const response = await fetch(`https://huggingface.co/api/models/${repoId}`);
if (!response.ok) {
  return { ...MODEL_DESCRIPTIONS[repoId], stale: true } satisfies HuggingFaceModelInfo;
}
Defensive patterns

Strategy: try-catch

Validate before calling

const HF_REPO_RE = /^[\w.-]+\/[\w.-]+$/;
function isValidRepoId(repoId: string): boolean {
  return HF_REPO_RE.test(repoId);
}

Type guard

function isHuggingFaceModelInfo(v: unknown): v is HuggingFaceModelInfo {
  return typeof v === 'object' && v !== null && ('id' in v || 'siblings' in v || 'modelId' in v);
}

Try / catch

try {
  return await fetchHuggingFaceModelInfo(repoId);
} catch (e) {
  // Fall back to the static description rather than crashing the UI.
  return { ...MODEL_DESCRIPTIONS[repoId], stale: true } as HuggingFaceModelInfo;
}

Prevention

When it happens

Trigger: GET https://huggingface.co/api/models/<repoId> responds 404 (repo id typo, renamed/gated repo), 401/403 (gated model requiring login), 429 (rate limit), or 5xx. Network failures throw before the status check.

Common situations: Hard-coded MODEL_DESCRIPTIONS repo ids drift from real HF repo names after a rename. A model becomes gated and now requires acceptance. Heavy shared-IP usage (CI, NAT) trips HF's 429. A user on a network blocking huggingface.co sees a fetch failure.

Related errors


AI-assisted analysis of jamiepine/voicebox@51f49dea19 (2026-08-12). Data as JSON: /api/errors/6df03c0a4d6ef6ad. Report an issue: GitHub.