{"record":{"id":"73f6b36de56e1001","repo":"vercel/ai","slug":"embeddingmodel-73f6b3","errorCode":null,"errorMessage":"embeddingModel","messagePattern":"embeddingModel","errorType":"exception","errorClass":"NoSuchModelError","httpStatus":null,"severity":"error","filePath":"packages/minimax/src/minimax-provider.ts","lineNumber":146,"sourceCode":"\n  const createVideoModel = (modelId: MiniMaxVideoModelId) =>\n    new MiniMaxVideoModel(modelId, {\n      provider: 'minimax.video',\n      baseURL: videoBaseURL,\n      headers: getVideoHeaders,\n      fetch: options.fetch,\n    });\n\n  const provider = (modelId: MiniMaxChatModelId) => createChatModel(modelId);\n\n  provider.specificationVersion = 'v4' as const;\n  provider.languageModel = createChatModel;\n  provider.chat = createChatModel;\n  provider.video = createVideoModel;\n  provider.videoModel = createVideoModel;\n\n  provider.embeddingModel = (modelId: string) => {\n    throw new NoSuchModelError({ modelId, modelType: 'embeddingModel' });\n  };\n  provider.textEmbeddingModel = provider.embeddingModel;\n  provider.imageModel = (modelId: string) => {\n    throw new NoSuchModelError({ modelId, modelType: 'imageModel' });\n  };\n\n  return provider;\n}\n\nexport const minimax = createMiniMax();\n","sourceCodeStart":128,"sourceCodeEnd":157,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/minimax/src/minimax-provider.ts#L128-L157","documentation":"The MiniMax provider instance does not implement embedding models: calling minimax.embeddingModel(modelId) (or minimax.textEmbeddingModel) always throws NoSuchModelError with modelType 'embeddingModel'. The provider only supports chat/language and video models; embeddings are intentionally unavailable.","triggerScenarios":"Calling minimax.embeddingModel(id), minimax.textEmbeddingModel(id), or passing the minimax provider to an API that resolves an embedding model internally, e.g. embed({ model: minimax.embeddingModel('...') }) or embedMany with the minimax provider.","commonSituations":"Developers switching a codebase from another provider (e.g. openai.textEmbeddingModel) to minimax assuming feature parity, or generically selecting a provider's embeddingModel factory in embedding pipelines.","solutions":["Use a provider that implements text embeddings (e.g. openai.textEmbeddingModel('text-embedding-3-small'), amazon-bedrock, google) for embed/embedMany calls.","Keep minimax only for language/chat (minimax(modelId) or minimax.chat) and video (minimax.videoModel) models.","Guard embedding code paths with a capability check instead of unconditionally calling provider.embeddingModel."],"exampleFix":"// before\nconst { embedding } = await embed({\n  model: minimax.embeddingModel('embo-1'),\n  value: text,\n});\n// after\nconst { embedding } = await embed({\n  model: openai.textEmbeddingModel('text-embedding-3-small'),\n  value: text,\n});","handlingStrategy":"validation","validationCode":"if (!('textEmbeddingModel' in minimax) || isStubModelFactory(minimax.embeddingModel)) {\n  throw new Error('minimax does not support embeddings; choose another provider');\n}\n// or simply: use openai.textEmbeddingModel / cohere / amazon-bedrock for embed()","typeGuard":"function supportsEmbeddings(p: any): p is { textEmbeddingModel: (id: string) => EmbeddingModel } {\n  try { p.textEmbeddingModel('probe'); return true; } catch { return false; }\n}","tryCatchPattern":"try {\n  await embed({ model: provider.textEmbeddingModel(id), value });\n} catch (e) {\n  if (NoSuchModelError.isInstance(e) && e.modelType === 'embeddingModel') {\n    // fall back to an embedding-capable provider\n  }\n  throw e;\n}","preventionTips":["Check the provider's supported model types before wiring embed/embedMany","Keep a provider-feature matrix in your app config","Centralize provider selection so capability checks live in one place","Add type-level tests asserting which factories you rely on"],"tags":["minimax","unsupported-model-type","embeddings","nosuchmodelerror"],"backgroundTag":"nosuch-model-error","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}