vercel/ai · error · NoSuchModelError
embeddingModel
Error message
embeddingModel
What it means
The fal provider does not support embedding models, so its embeddingModel factory always throws NoSuchModelError with modelType 'embeddingModel' and the requested modelId. Any attempt to obtain or call an embedding model from the fal provider fails by design.
Source
Thrown at packages/fal/src/fal-provider.ts:178
const createTranscriptionModel = (modelId: FalTranscriptionModelId) =>
new FalTranscriptionModel(modelId, {
provider: `fal.transcription`,
url: ({ path }) => path,
headers: getHeaders,
fetch: options.fetch,
});
const createVideoModel = (modelId: FalVideoModelId) =>
new FalVideoModel(modelId, {
provider: 'fal.video',
url: ({ path }) => path,
headers: getHeaders,
fetch: options.fetch,
});
const embeddingModel = (modelId: string) => {
throw new NoSuchModelError({
modelId,
modelType: 'embeddingModel',
});
};
return {
specificationVersion: 'v4' as const,
imageModel: createImageModel,
image: createImageModel,
languageModel: (modelId: string) => {
throw new NoSuchModelError({
modelId,
modelType: 'languageModel',
});
},
speech: createSpeechModel,
embeddingModel,
textEmbeddingModel: embeddingModel,View on GitHub (pinned to 69428b1f8b)
Solutions
- Use a provider that implements embedding models (e.g. openai, google, amazon-bedrock, cohere) for embed/embedMany.
- Do not register fal as the provider for embedding use cases.
- Check provider capability docs before routing model requests.
Example fix
// before
const { embedding } = await embed({ model: fal.embeddingModel('x'), value: 'hi' });
// after
const { embedding } = await embed({ model: openai.embedding('text-embedding-3-small'), value: 'hi' }); Defensive patterns
Strategy: fallback
Validate before calling
// route embeddings to a provider that supports them
const supportsEmbeddings = (p: unknown) =>
typeof (p as { embeddingModel?: unknown })?.embeddingModel === 'function' &&
(p as { provider?: string }).provider !== 'fal'; Try / catch
let model;
try {
model = fal.embeddingModel(id);
} catch (e) {
if (NoSuchModelError.isInstance(e) && e.modelType === 'embeddingModel') {
model = openai.embedding('text-embedding-3-small');
} else throw e;
} Prevention
- Maintain a capability matrix mapping providers to supported model types.
- Never set fal as a default/global provider for embedding workloads.
- Check provider docs for embedding support before wiring embed()/embedMany().
When it happens
Trigger: Calling fal.embeddingModel('some-model') or passing the fal provider where an embedding model is resolved (e.g. embed()/embedMany() with fal as the provider).
Common situations: Developers assume fal supports embeddings because it supports image/video generation, or they configure fal as a global default provider and then call embed().
Related errors
- 'element streams in no-schema mode' functionality not suppor
- 'element streams in object mode' functionality not supported
- 'element streams in enum mode' functionality not supported.
- AI_UnsupportedFunctionalityError
- AI_UnsupportedFunctionalityError
AI-assisted analysis of vercel/ai@69428b1f8b (2026-08-30).
Data as JSON: /api/errors/b8507000006df8c3.
Report an issue: GitHub.