{"record":{"id":"46143eb90945893c","repo":"vercel/ai","slug":"languagemodel","errorCode":null,"errorMessage":"languageModel","messagePattern":"languageModel","errorType":"exception","errorClass":"NoSuchModelError","httpStatus":null,"severity":"error","filePath":"packages/fal/src/fal-provider.ts","lineNumber":189,"sourceCode":"      provider: 'fal.video',\n      url: ({ path }) => path,\n      headers: getHeaders,\n      fetch: options.fetch,\n    });\n\n  const embeddingModel = (modelId: string) => {\n    throw new NoSuchModelError({\n      modelId,\n      modelType: 'embeddingModel',\n    });\n  };\n\n  return {\n    specificationVersion: 'v4' as const,\n    imageModel: createImageModel,\n    image: createImageModel,\n    languageModel: (modelId: string) => {\n      throw new NoSuchModelError({\n        modelId,\n        modelType: 'languageModel',\n      });\n    },\n    speech: createSpeechModel,\n    embeddingModel,\n    textEmbeddingModel: embeddingModel,\n    transcription: createTranscriptionModel,\n    video: createVideoModel,\n    videoModel: createVideoModel,\n  };\n}\n\n/**\n * Default fal.ai provider instance.\n */\nexport const fal = createFal();\n","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/fal/src/fal-provider.ts#L171-L207","documentation":"fal.ai does not support language models in the AI SDK, so the provider's `languageModel` factory always throws `NoSuchModelError` with modelType 'languageModel'. The fal provider only implements image, speech, and embedding models. Calling `fal.languageModel(...)` (or `fal(...)` for a language model) is always a programming error, never a runtime condition.","triggerScenarios":"Calling `fal('some-model-id')` or `fal.languageModel('some-model-id')` and passing the result to generateText/streamText. Any code path that resolves a model via the provider's languageModel entry point.","commonSituations":"Developers assuming fal supports text generation because most AI SDK providers do; copy-pasting code written for openai/anthropic providers and swapping in `fal`; confusion between fal's image/speech capabilities and LLM support.","solutions":["Use a text-capable provider (e.g. @ai-sdk/openai, @ai-sdk/anthropic) for generateText/streamText calls","Use fal only for its supported capabilities: createFal image models (fal.image(...)), speech models, or embeddingModel","If you need both text and fal media generation, keep two providers and pass the right one to each function"],"exampleFix":"// before\nconst model = fal('fal-ai/flux');\nawait generateText({ model, prompt: 'hi' });\n// after\nconst imageModel = fal.image('fal-ai/flux/dev');\nconst { image } = await generateImage({ model: imageModel, prompt: 'a cat' });","handlingStrategy":"try-catch","validationCode":"import { NoSuchModelError } from '@ai-sdk/provider';\nconst supportsLanguageModels = typeof fal.languageModel === 'function' && !isUnsupportedStub(fal);\n// simply: never call fal.languageModel — check provider docs/capability before use","typeGuard":"function isNoSuchModelError(e: unknown): e is NoSuchModelError {\n  return NoSuchModelError.isInstance(e);\n}","tryCatchPattern":"try {\n  await generateText({ model: fal('id'), prompt });\n} catch (e) {\n  if (NoSuchModelError.isInstance(e) && e.modelType === 'languageModel') {\n    // fall back to an LLM-capable provider\n  }\n  throw e;\n}","preventionTips":["Never use fal/fish-audio providers for generateText/streamText — check provider docs for supported model types","Keep media generation (image/speech) and text generation in separate provider configurations","Wrap dynamic provider dispatch with a capability check before calling languageModel"],"tags":["unsupported-model-type","provider-api","fal","typescript"],"backgroundTag":"unsupported-model-type","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}