vercel/ai · error · NoSuchModelError

Fish Audio does not provide language models

Error message

Fish Audio does not provide language models

What it means

Fish Audio is a speech/transcription provider; the ProviderV4 interface requires a `languageModel` method, so the factory is implemented to always throw `NoSuchModelError` with a message explaining Fish Audio does not provide language models. Calling it is always a misuse of the provider, never a transient condition.

Source

Thrown at packages/fish-audio/src/fish-audio-provider.ts:133

      headers: getHeaders,
      fetch: options.fetch,
    });

  const provider = function (modelId: FishAudioSpeechModelId) {
    return {
      speech: createSpeechModel(modelId),
    };
  };

  provider.specificationVersion = 'v4' as const;
  provider.speech = createSpeechModel;
  provider.speechModel = createSpeechModel;
  provider.transcription = createTranscriptionModel;
  provider.transcriptionModel = createTranscriptionModel;

  // Required ProviderV4 methods that are not supported
  provider.languageModel = (modelId: string) => {
    throw new NoSuchModelError({
      modelId,
      modelType: 'languageModel',
      message: 'Fish Audio does not provide language models',
    });
  };

  provider.embeddingModel = (modelId: string) => {
    throw new NoSuchModelError({
      modelId,
      modelType: 'embeddingModel',
      message: 'Fish Audio does not provide embedding models',
    });
  };
  provider.textEmbeddingModel = provider.embeddingModel;

  provider.imageModel = (modelId: string) => {
    throw new NoSuchModelError({
      modelId,

View on GitHub (pinned to 69428b1f8b)

Solutions

  1. Use fishAudio only for its supported capabilities: speechModel (TTS) and transcription models
  2. Use an LLM provider (e.g. @ai-sdk/openai) for generateText/streamText
  3. Combine providers: one for text generation, fish-audio for speech/transcription

Example fix

// before
const model = fishAudio('speech-01');
await generateText({ model, prompt: 'hello' });
// after
const speechModel = fishAudio.speech('speech-01');
const { audio } = await generateSpeech({ model: speechModel, text: 'hello' });
Defensive patterns

Strategy: try-catch

Validate before calling

import { NoSuchModelError } from '@ai-sdk/provider';
// before dispatching to fishAudio, ensure the model type is speech/transcription
const isSpeechUse = taskKind === 'speech' || taskKind === 'transcription';
if (!isSpeechUse) useTextProviderInstead();

Type guard

function isNoSuchModelError(e: unknown): e is NoSuchModelError {
  return NoSuchModelError.isInstance(e);
}

Try / catch

try {
  return await generateText({ model: fishAudio('id'), prompt });
} catch (e) {
  if (NoSuchModelError.isInstance(e)) {
    return generateText({ model: openai('gpt-4o'), prompt });
  }
  throw e;
}

Prevention

When it happens

Trigger: Calling `fishAudio('some-id')` or `fishAudio.languageModel('some-id')` and using it with generateText/streamText/embed.

Common situations: Assuming fish-audio supports text generation; refactoring code that previously used an LLM provider and swapping in fishAudio; using fishAudio as a default provider for all model types.

Related errors


AI-assisted analysis of vercel/ai@69428b1f8b (2026-08-30). Data as JSON: /api/errors/1acb3014c458d025. Report an issue: GitHub.