vercel/ai · error · NoSuchModelError

embeddingModel

Error message

embeddingModel

What it means

AssemblyAI's `embeddingModel` (and therefore `textEmbeddingModel`) is a stub that unconditionally throws NoSuchModelError with modelType 'embeddingModel'. The provider offers no embeddings API.

Source

Thrown at packages/assemblyai/src/assemblyai-provider.ts:98

    return {
      transcription: createTranscriptionModel(modelId),
    };
  };

  provider.specificationVersion = 'v4' as const;
  provider.transcription = createTranscriptionModel;
  provider.transcriptionModel = createTranscriptionModel;

  provider.languageModel = () => {
    throw new NoSuchModelError({
      modelId: 'unknown',
      modelType: 'languageModel',
      message: 'AssemblyAI does not provide language models',
    });
  };

  provider.embeddingModel = (modelId: string) => {
    throw new NoSuchModelError({ modelId, modelType: 'embeddingModel' });
  };
  provider.textEmbeddingModel = provider.embeddingModel;

  provider.imageModel = (modelId: string) => {
    throw new NoSuchModelError({ modelId, modelType: 'imageModel' });
  };

  return provider as AssemblyAIProvider;
}

/**
 * Default AssemblyAI provider instance.
 */
export const assemblyai = createAssemblyAI();

View on GitHub (pinned to 69428b1f8b)

Solutions

  1. Use an embeddings-capable provider such as OpenAI (`createOpenAI().embedding('text-embedding-3-small')`), Google, or Amazon Bedrock.
  2. Keep AssemblyAI strictly for transcription tasks and configure a separate embedding provider.

Example fix

// before
const { embedding } = await embed({ model: assemblyai.embeddingModel('x'), value: text });
// after
const { embedding } = await embed({ model: openai.embedding('text-embedding-3-small'), value: text });
Defensive patterns

Strategy: fallback

Validate before calling

if (providerId === 'assemblyai') {
  throw new Error('AssemblyAI provides no embeddings; configure an embeddings provider');
}

Type guard

function supportsEmbeddings(p: any): boolean {
  try {
    p.embeddingModel?.('probe');
    return true;
  } catch (e) {
    return !(NoSuchModelError.isInstance(e) && e.modelType === 'embeddingModel');
  }
}

Try / catch

try {
  return assemblyai.textEmbeddingModel(id);
} catch (error) {
  if (NoSuchModelError.isInstance(error) && error.modelType === 'embeddingModel') {
    return openai.embedding('text-embedding-3-small');
  }
  throw error;
}

Prevention

When it happens

Trigger: Calling `assemblyai.embeddingModel('any-id')` or `assemblyai.textEmbeddingModel(...)`; using the provider in `embed()`/`embedMany()` pipelines.

Common situations: Generic RAG stacks that request embeddings from whichever provider is configured; provider parity assumptions when swapping OpenAI for AssemblyAI in shared configuration.

Related errors


AI-assisted analysis of vercel/ai@69428b1f8b (2026-08-30). Data as JSON: /api/errors/b72857a06510f58f. Report an issue: GitHub.