vercel/ai · error · NoSuchModelError
Fish Audio does not provide image models
Error message
Fish Audio does not provide image models
What it means
The Fish Audio provider's `imageModel` always throws `NoSuchModelError` because Fish Audio does not generate images. Like the other unsupported model types, this stub fulfills the ProviderV4 interface requirement and explains the limitation in its message.
Source
Thrown at packages/fish-audio/src/fish-audio-provider.ts:150
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,
modelType: 'imageModel',
message: 'Fish Audio does not provide image models',
});
};
return provider as FishAudioProvider;
}
/**
* Default Fish Audio provider instance.
*/
export const fishAudio = createFishAudio();
View on GitHub (pinned to 69428b1f8b)
Solutions
- Use an image-capable provider (e.g. @ai-sdk/fal, @ai-sdk/fireworks, @ai-sdk/openai) with generateImage
- Limit fishAudio to its speech and transcription capabilities
- Check provider capabilities before dispatching media generation to a dynamically selected provider
Example fix
// before
const model = fishAudio.imageModel('img');
await generateImage({ model, prompt: 'a cat' });
// after
const model = fal.image('fal-ai/flux/dev');
await generateImage({ model, prompt: 'a cat' }); Defensive patterns
Strategy: validation
Validate before calling
// route image generation only to image-capable providers
const IMAGE_PROVIDERS = new Set(['fal', 'fireworks', 'openai', 'google', 'amazon-bedrock']);
if (!IMAGE_PROVIDERS.has(providerName)) throw new Error(`${providerName} does not support image generation`); Type guard
function isNoSuchModelError(e: unknown): e is NoSuchModelError {
return NoSuchModelError.isInstance(e);
} Try / catch
try {
return await generateImage({ model: fishAudio.imageModel('x'), prompt });
} catch (e) {
if (NoSuchModelError.isInstance(e) && e.modelType === 'imageModel') {
return generateImage({ model: fal.image('fal-ai/flux/dev'), prompt });
}
throw e;
} Prevention
- Only call generateImage with image-capable providers (fal, fireworks, openai, google)
- Keep a provider capability registry for media generation dispatch
- Restrict fishAudio imports to speech/transcription modules to avoid accidental use
When it happens
Trigger: Calling `fishAudio.imageModel('id')` or passing the fishAudio provider to generateImage.
Common situations: Provider-agnostic image generation code that assumes all providers implement imageModel; swapping fal/fireworks for fishAudio without checking capabilities.
Related errors
- Fish Audio does not provide language models
- Fish Audio does not provide embedding models
- imageModel
- imageModel
- languageModel
AI-assisted analysis of vercel/ai@69428b1f8b (2026-08-30).
Data as JSON: /api/errors/fdfcfa1c2f967a78.
Report an issue: GitHub.