vercel/ai · error · NoSuchModelError
LMNT does not provide language models
Error message
LMNT does not provide language models
What it means
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.
Source
Thrown at packages/lmnt/src/lmnt-provider.ts:83
new LMNTSpeechModel(modelId, {
provider: `lmnt.speech`,
url: ({ path }) => `https://api.lmnt.com${path}`,
headers: getHeaders,
fetch: options.fetch,
});
const provider = function (modelId: LMNTSpeechModelId) {
return {
speech: createSpeechModel(modelId),
};
};
provider.specificationVersion = 'v4' as const;
provider.speech = createSpeechModel;
provider.speechModel = createSpeechModel;
provider.languageModel = (modelId: string) => {
throw new NoSuchModelError({
modelId,
modelType: 'languageModel',
message: 'LMNT does not provide language models',
});
};
provider.embeddingModel = (modelId: string) => {
throw new NoSuchModelError({
modelId,
modelType: 'embeddingModel',
message: 'LMNT does not provide embedding models',
});
};
provider.imageModel = (modelId: string) => {
throw new NoSuchModelError({
modelId,
modelType: 'imageModel',View on GitHub (pinned to 69428b1f8b)
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
Example fix
// before
const result = await generateText({ model: lmnt('lmnt-model'), prompt: 'hi' });
// after
const result = await generateText({ model: openai('gpt-4o'), prompt: 'hi' });
const audio = await generateSpeech({ model: lmnt.speech('aurora'), text: 'hello' }); Defensive patterns
Strategy: type-guard
Validate before calling
// pick a provider that actually has language models
const languageModel = providerIsLMNT(configuredProvider)
? openai('gpt-4o')
: configuredProvider(modelId); Type guard
function isLMNT(p: unknown): boolean {
return typeof p === 'function' && p === lmnt;
}
// or narrow by capability:
function hasLanguageModel(p: any): boolean {
try { p.languageModel?.('probe'); return true; } catch { return false; }
} Try / catch
try {
await generateText({ model: lmnt(modelId), prompt });
} catch (e) {
if (NoSuchModelError.isInstance(e) && e.modelType === 'languageModel') {
// switch to a text provider or lmnt.speech(modelId)
} else throw e;
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- LMNT does not provide embedding models
- LMNT does not provide image models
- Model could not be resolved
- No speech audio generated.
- No video generated.
AI-assisted analysis of vercel/ai@69428b1f8b (2026-08-30).
Data as JSON: /api/errors/be748c9b32e6e4f2.
Report an issue: GitHub.