{"record":{"id":"e0ef071bac332d88","repo":"vercel/ai","slug":"the-groq-model-function-cannot-be-called-with-the","errorCode":null,"errorMessage":"The Groq model function cannot be called with the new keyword.","messagePattern":"The Groq model function cannot be called with the new keyword\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/groq/src/groq-provider.ts","lineNumber":100,"sourceCode":"          environmentVariableName: 'GROQ_API_KEY',\n          description: 'Groq',\n        })}`,\n        ...options.headers,\n      },\n      `ai-sdk/groq/${VERSION}`,\n    );\n\n  const createChatModel = (modelId: GroqChatModelId) =>\n    new GroqChatLanguageModel(modelId, {\n      provider: 'groq.chat',\n      url: ({ path }) => `${baseURL}${path}`,\n      headers: getHeaders,\n      fetch: options.fetch,\n    });\n\n  const createLanguageModel = (modelId: GroqChatModelId) => {\n    if (new.target) {\n      throw new Error(\n        'The Groq model function cannot be called with the new keyword.',\n      );\n    }\n\n    return createChatModel(modelId);\n  };\n\n  const createTranscriptionModel = (modelId: GroqTranscriptionModelId) => {\n    return new GroqTranscriptionModel(modelId, {\n      provider: 'groq.transcription',\n      url: ({ path }) => `${baseURL}${path}`,\n      headers: getHeaders,\n      fetch: options.fetch,\n    });\n  };\n\n  const provider = function (modelId: GroqChatModelId) {\n    return createLanguageModel(modelId);","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/groq/src/groq-provider.ts#L82-L118","documentation":"Error \"The Groq model function cannot be called with the new keyword.\" thrown in vercel/ai.","triggerScenarios":"Thrown at packages/groq/src/groq-provider.ts:100 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}