{"record":{"id":"be748c9b32e6e4f2","repo":"vercel/ai","slug":"lmnt-does-not-provide-language-models","errorCode":null,"errorMessage":"LMNT does not provide language models","messagePattern":"LMNT does not provide language models","errorType":"exception","errorClass":"NoSuchModelError","httpStatus":null,"severity":"error","filePath":"packages/lmnt/src/lmnt-provider.ts","lineNumber":83,"sourceCode":"    new LMNTSpeechModel(modelId, {\n      provider: `lmnt.speech`,\n      url: ({ path }) => `https://api.lmnt.com${path}`,\n      headers: getHeaders,\n      fetch: options.fetch,\n    });\n\n  const provider = function (modelId: LMNTSpeechModelId) {\n    return {\n      speech: createSpeechModel(modelId),\n    };\n  };\n\n  provider.specificationVersion = 'v4' as const;\n  provider.speech = createSpeechModel;\n  provider.speechModel = createSpeechModel;\n\n  provider.languageModel = (modelId: string) => {\n    throw new NoSuchModelError({\n      modelId,\n      modelType: 'languageModel',\n      message: 'LMNT does not provide language models',\n    });\n  };\n\n  provider.embeddingModel = (modelId: string) => {\n    throw new NoSuchModelError({\n      modelId,\n      modelType: 'embeddingModel',\n      message: 'LMNT does not provide embedding models',\n    });\n  };\n\n  provider.imageModel = (modelId: string) => {\n    throw new NoSuchModelError({\n      modelId,\n      modelType: 'imageModel',","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/lmnt/src/lmnt-provider.ts#L65-L101","documentation":"LMNT is a speech (TTS) provider only. Its provider object wires languageModel to a function that always throws NoSuchModelError with this message, so any attempt to load a language model from the LMNT provider fails immediately with the requested modelId echoed back.","triggerScenarios":"Calling lmnt('some-model-id') as a language model, e.g. lmnt.languageModel('x') or passing the LMNT provider where a LanguageModel is expected in generateText/streamText.","commonSituations":"Mistaking LMNT for a full-model provider, copy-pasting provider setup from OpenAI examples, or a registry/config wiring lmnt into the wrong model slot.","solutions":["Use the provider's speech API instead: lmnt.speech(modelId) or lmnt.speechModel(modelId)","Use a text-capable provider (openai, anthropic, etc.) for languageModel slots","Check your model registry/config so LMNT is only mapped to speech endpoints"],"exampleFix":"// before\nconst result = await generateText({ model: lmnt('lmnt-model'), prompt: 'hi' });\n// after\nconst result = await generateText({ model: openai('gpt-4o'), prompt: 'hi' });\nconst audio = await generateSpeech({ model: lmnt.speech('aurora'), text: 'hello' });","handlingStrategy":"type-guard","validationCode":"// pick a provider that actually has language models\nconst languageModel = providerIsLMNT(configuredProvider)\n  ? openai('gpt-4o')\n  : configuredProvider(modelId);","typeGuard":"function isLMNT(p: unknown): boolean {\n  return typeof p === 'function' && p === lmnt;\n}\n// or narrow by capability:\nfunction hasLanguageModel(p: any): boolean {\n  try { p.languageModel?.('probe'); return true; } catch { return false; }\n}","tryCatchPattern":"try {\n  await generateText({ model: lmnt(modelId), prompt });\n} catch (e) {\n  if (NoSuchModelError.isInstance(e) && e.modelType === 'languageModel') {\n    // switch to a text provider or lmnt.speech(modelId)\n  } else throw e;\n}","preventionTips":["Map LMNT only to speech endpoints in your model registry","Consult provider docs on supported modalities before wiring","Use a central factory that assigns providers by capability","Add type tests so wrong provider/model combinations fail at build time where possible"],"tags":["provider","no-such-model","speech","wrong-provider"],"backgroundTag":"unsupported-model-type","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}