coleam00 / bolt.new-any-llm

Prompt, run, edit, and deploy full-stack web applications using any LLM you want!
https://bolt.new
MIT License
3.85k stars 1.58k forks source link

### Bug Report: Mistral Models Fail to Work After Adding API Key #341

Closed champ2050 closed 2 days ago

champ2050 commented 2 days ago

Describe the bug

Description
After entering the API key in the .env file for Mistral, none of the models work. The following error is displayed:
There was an error processing your request: No details were returned

Link to the Bolt URL that caused the error

http://localhost:5173/chat/19

Steps to reproduce

  1. Add the API key to the .env file.
  2. Attempt to use any Mistral model.
  3. Observe the error message.

Expected behavior

The Mistral models should process the request and provide a response.

Screen Recording / Screenshot

No response

Platform

Additional context

This issue is consistent across all attempts to use Mistral models. Logs below:

Logs

`APICallError [AI_APICallError]: Unauthorized at file:///C:/Users/slowp/Desktop/AI/bolt.new-any-llm/node_modules/.pnpm/@ai-sdk+provider-utils@1.0.20_zod@3.23.8/node_modules/@ai-sdk/provider-utils/dist/index.mjs:445:14 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async postToApi (file:///C:/Users/slowp/Desktop/AI/bolt.new-any-llm/node_modules/.pnpm/@ai-sdk+provider-utils@1.0.20_zod@3.23.8/node_modules/@ai-sdk/provider-utils/dist/index.mjs:336:28) at async MistralChatLanguageModel.doStream (file:///C:/Users/slowp/Desktop/AI/bolt.new-any-llm/node_modules/.pnpm/@ai-sdk+mistral@0.0.43_zod@3.23.8/node_modules/@ai-sdk/mistral/dist/index.mjs:298:50) at async fn (file:///C:/Users/slowp/Desktop/AI/bolt.new-any-llm/node_modules/.pnpm/ai@3.4.9_react@18.3.1_sswr@2.1.0_svelte@4.2.18svelte@4.2.18_vue@3.4.30_typescript@5.5.2zod@3.23.8/node_modules/ai/dist/index.mjs:3938:23) at async file:///C:/Users/slowp/Desktop/AI/bolt.new-any-llm/node_modules/.pnpm/ai@3.4.9_react@18.3.1_sswr@2.1.0_svelte@4.2.18svelte@4.2.18_vue@3.4.30_typescript@5.5.2zod@3.23.8/node_modules/ai/dist/index.mjs:256:22 at async _retryWithExponentialBackoff (file:///C:/Users/slowp/Desktop/AI/bolt.new-any-llm/node_modules/.pnpm/ai@3.4.9_react@18.3.1_sswr@2.1.0_svelte@4.2.18svelte@4.2.18_vue@3.4.30_typescript@5.5.2zod@3.23.8/node_modules/ai/dist/index.mjs:86:12) at async startStep (file:///C:/Users/slowp/Desktop/AI/bolt.new-any-llm/node_modules/.pnpm/ai@3.4.9_react@18.3.1_sswr@2.1.0_svelte@4.2.18svelte@4.2.18_vue@3.4.30_typescript@5.5.2zod@3.23.8/node_modules/ai/dist/index.mjs:3903:13) at async fn (file:///C:/Users/slowp/Desktop/AI/bolt.new-any-llm/node_modules/.pnpm/ai@3.4.9_react@18.3.1_sswr@2.1.0_svelte@4.2.18svelte@4.2.18_vue@3.4.30_typescript@5.5.2zod@3.23.8/node_modules/ai/dist/index.mjs:3977:11) at async file:///C:/Users/slowp/Desktop/AI/bolt.new-any-llm/node_modules/.pnpm/ai@3.4.9_react@18.3.1_sswr@2.1.0_svelte@4.2.18svelte@4.2.18_vue@3.4.30_typescript@5.5.2zod@3.23.8/node_modules/ai/dist/index.mjs:256:22 at async chatAction (C:/Users/slowp/Desktop/AI/bolt.new-any-llm/app/routes/api.chat.ts:64:20) at async Object.callRouteAction (C:\Users\slowp\Desktop\AI\bolt.new-any-llm\node_modules.pnpm\@remix-run+server-runtime@2.10.0_typescript@5.5.2\node_modules\@remix-run\server-runtime\dist\data.js:37:16) at async C:\Users\slowp\Desktop\AI\bolt.new-any-llm\node_modules.pnpm\@remix-run+router@1.17.0\node_modules\@remix-run\router\dist\router.cjs.js:4612:21 at async callLoaderOrAction (C:\Users\slowp\Desktop\AI\bolt.new-any-llm\node_modules.pnpm\@remix-run+router@1.17.0\node_modules\@remix-run\router\dist\router.cjs.js:4677:16) at async Promise.all (index 1) at async callDataStrategyImpl (C:\Users\slowp\Desktop\AI\bolt.new-any-llm\node_modules.pnpm\@remix-run+router@1.17.0\node_modules\@remix-run\router\dist\router.cjs.js:4552:17) at async callDataStrategy (C:\Users\slowp\Desktop\AI\bolt.new-any-llm\node_modules.pnpm\@remix-run+router@1.17.0\node_modules\@remix-run\router\dist\router.cjs.js:4041:19) at async submit (C:\Users\slowp\Desktop\AI\bolt.new-any-llm\node_modules.pnpm\@remix-run+router@1.17.0\node_modules\@remix-run\router\dist\router.cjs.js:3900:21) at async queryImpl (C:\Users\slowp\Desktop\AI\bolt.new-any-llm\node_modules.pnpm\@remix-run+router@1.17.0\node_modules\@remix-run\router\dist\router.cjs.js:3858:22) at async Object.queryRoute (C:\Users\slowp\Desktop\AI\bolt.new-any-llm\node_modules.pnpm\@remix-run+router@1.17.0\node_modules\@remix-run\router\dist\router.cjs.js:3827:18) at async handleResourceRequest (C:\Users\slowp\Desktop\AI\bolt.new-any-llm\node_modules.pnpm\@remix-run+server-runtime@2.10.0_typescript@5.5.2\node_modules\@remix-run\server-runtime\dist\server.js:413:20) at async requestHandler (C:\Users\slowp\Desktop\AI\bolt.new-any-llm\node_modules.pnpm\@remix-run+server-runtime@2.10.0_typescript@5.5.2\node_modules\@remix-run\server-runtime\dist\server.js:156:18) at async C:\Users\slowp\Desktop\AI\bolt.new-any-llm\nodemodules.pnpm\@remix-run+dev@2.10.0@remix-run+react@2.10.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_typ_qwyxqdhnwp3srgtibfrlais3ge\node_modules\@remix-run\dev\dist\vite\cloudflare-proxy-plugin.js:70:25 { cause: undefined, url: 'https://api.mistral.ai/v1/chat/completions', requestBodyValues: { model: 'mistral-large-latest', safe_prompt: undefined, max_tokens: 8000, temperature: 0, top_p: undefined, random_seed: undefined, response_format: undefined, messages: [ [Object], [Object] ], tools: undefined, tool_choice: undefined, stream: true }, statusCode: 401, responseHeaders: { 'access-control-allow-origin': '*', 'alt-svc': 'h3=":443"; ma=86400', 'cf-cache-status': 'DYNAMIC', 'cf-ray': '8e5456e039e6f3ed-BOM', connection: 'keep-alive', 'content-length': '81', 'content-type': 'application/json; charset=utf-8', date: 'Wed, 20 Nov 2024 00:31:49 GMT', server: 'cloudflare', 'www-authenticate': 'Key', 'x-kong-request-id': 'd094f8557656ef266ae81c653b6b0e1d', 'x-kong-response-latency': '0' }, responseBody: '{\n' + ' "message":"Unauthorized",\n' + ' "request_id":"d094f8557656ef266ae81c653b6b0e1d"\n' + '}', isRetryable: false, data: undefined,

} APICallError [AI_APICallError]: Unauthorized at file:///C:/Users/slowp/Desktop/AI/bolt.new-any-llm/node_modules/.pnpm/@ai-sdk+provider-utils@1.0.20_zod@3.23.8/node_modules/@ai-sdk/provider-utils/dist/index.mjs:445:14 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async postToApi (file:///C:/Users/slowp/Desktop/AI/bolt.new-any-llm/node_modules/.pnpm/@ai-sdk+provider-utils@1.0.20_zod@3.23.8/node_modules/@ai-sdk/provider-utils/dist/index.mjs:336:28) at async MistralChatLanguageModel.doStream (file:///C:/Users/slowp/Desktop/AI/bolt.new-any-llm/node_modules/.pnpm/@ai-sdk+mistral@0.0.43_zod@3.23.8/node_modules/@ai-sdk/mistral/dist/index.mjs:298:50) at async fn (file:///C:/Users/slowp/Desktop/AI/bolt.new-any-llm/node_modules/.pnpm/ai@3.4.9_react@18.3.1_sswr@2.1.0_svelte@4.2.18svelte@4.2.18_vue@3.4.30_typescript@5.5.2zod@3.23.8/node_modules/ai/dist/index.mjs:3938:23) at async file:///C:/Users/slowp/Desktop/AI/bolt.new-any-llm/node_modules/.pnpm/ai@3.4.9_react@18.3.1_sswr@2.1.0_svelte@4.2.18svelte@4.2.18_vue@3.4.30_typescript@5.5.2zod@3.23.8/node_modules/ai/dist/index.mjs:256:22 at async _retryWithExponentialBackoff (file:///C:/Users/slowp/Desktop/AI/bolt.new-any-llm/node_modules/.pnpm/ai@3.4.9_react@18.3.1_sswr@2.1.0_svelte@4.2.18svelte@4.2.18_vue@3.4.30_typescript@5.5.2zod@3.23.8/node_modules/ai/dist/index.mjs:86:12) at async startStep (file:///C:/Users/slowp/Desktop/AI/bolt.new-any-llm/node_modules/.pnpm/ai@3.4.9_react@18.3.1_sswr@2.1.0_svelte@4.2.18svelte@4.2.18_vue@3.4.30_typescript@5.5.2zod@3.23.8/node_modules/ai/dist/index.mjs:3903:13) at async fn (file:///C:/Users/slowp/Desktop/AI/bolt.new-any-llm/node_modules/.pnpm/ai@3.4.9_react@18.3.1_sswr@2.1.0_svelte@4.2.18svelte@4.2.18_vue@3.4.30_typescript@5.5.2zod@3.23.8/node_modules/ai/dist/index.mjs:3977:11) at async file:///C:/Users/slowp/Desktop/AI/bolt.new-any-llm/node_modules/.pnpm/ai@3.4.9_react@18.3.1_sswr@2.1.0_svelte@4.2.18svelte@4.2.18_vue@3.4.30_typescript@5.5.2zod@3.23.8/node_modules/ai/dist/index.mjs:256:22 at async chatAction (C:/Users/slowp/Desktop/AI/bolt.new-any-llm/app/routes/api.chat.ts:64:20) at async Object.callRouteAction (C:\Users\slowp\Desktop\AI\bolt.new-any-llm\node_modules.pnpm\@remix-run+server-runtime@2.10.0_typescript@5.5.2\node_modules\@remix-run\server-runtime\dist\data.js:37:16) at async C:\Users\slowp\Desktop\AI\bolt.new-any-llm\node_modules.pnpm\@remix-run+router@1.17.0\node_modules\@remix-run\router\dist\router.cjs.js:4612:21 at async callLoaderOrAction (C:\Users\slowp\Desktop\AI\bolt.new-any-llm\node_modules.pnpm\@remix-run+router@1.17.0\node_modules\@remix-run\router\dist\router.cjs.js:4677:16) at async Promise.all (index 1) at async callDataStrategyImpl (C:\Users\slowp\Desktop\AI\bolt.new-any-llm\node_modules.pnpm\@remix-run+router@1.17.0\node_modules\@remix-run\router\dist\router.cjs.js:4552:17) at async callDataStrategy (C:\Users\slowp\Desktop\AI\bolt.new-any-llm\node_modules.pnpm\@remix-run+router@1.17.0\node_modules\@remix-run\router\dist\router.cjs.js:4041:19) at async submit (C:\Users\slowp\Desktop\AI\bolt.new-any-llm\node_modules.pnpm\@remix-run+router@1.17.0\node_modules\@remix-run\router\dist\router.cjs.js:3900:21) at async queryImpl (C:\Users\slowp\Desktop\AI\bolt.new-any-llm\node_modules.pnpm\@remix-run+router@1.17.0\node_modules\@remix-run\router\dist\router.cjs.js:3858:22) at async Object.queryRoute (C:\Users\slowp\Desktop\AI\bolt.new-any-llm\node_modules.pnpm\@remix-run+router@1.17.0\node_modules\@remix-run\router\dist\router.cjs.js:3827:18) at async handleResourceRequest (C:\Users\slowp\Desktop\AI\bolt.new-any-llm\node_modules.pnpm\@remix-run+server-runtime@2.10.0_typescript@5.5.2\node_modules\@remix-run\server-runtime\dist\server.js:413:20) at async requestHandler (C:\Users\slowp\Desktop\AI\bolt.new-any-llm\node_modules.pnpm\@remix-run+server-runtime@2.10.0_typescript@5.5.2\node_modules\@remix-run\server-runtime\dist\server.js:156:18) at async C:\Users\slowp\Desktop\AI\bolt.new-any-llm\nodemodules.pnpm\@remix-run+dev@2.10.0@remix-run+react@2.10.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_typ_qwyxqdhnwp3srgtibfrlais3ge\node_modules\@remix-run\dev\dist\vite\cloudflare-proxy-plugin.js:70:25 { cause: undefined, url: 'https://api.mistral.ai/v1/chat/completions', requestBodyValues: { model: 'codestral-latest', safe_prompt: undefined, max_tokens: 8000, temperature: 0, top_p: undefined, random_seed: undefined, response_format: undefined, messages: [ [Object], [Object] ], tools: undefined, tool_choice: undefined, stream: true }, statusCode: 401, responseHeaders: { 'access-control-allow-origin': '*', 'alt-svc': 'h3=":443"; ma=86400', 'cf-cache-status': 'DYNAMIC', 'cf-ray': '8e5457bfb8083df7-BOM', connection: 'keep-alive', 'content-length': '81', 'content-type': 'application/json; charset=utf-8', date: 'Wed, 20 Nov 2024 00:32:25 GMT', server: 'cloudflare', 'www-authenticate': 'Key', 'x-kong-request-id': '9744cc3e4014522ec85bc50bbee97133', 'x-kong-response-latency': '0' }, responseBody: '{\n' + ' "message":"Unauthorized",\n' + ' "request_id":"9744cc3e4014522ec85bc50bbee97133"\n' + '}', isRetryable: false, data: undefined,

} APICallError [AI_APICallError]: Unauthorized at file:///C:/Users/slowp/Desktop/AI/bolt.new-any-llm/node_modules/.pnpm/@ai-sdk+provider-utils@1.0.20_zod@3.23.8/node_modules/@ai-sdk/provider-utils/dist/index.mjs:445:14 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async postToApi (file:///C:/Users/slowp/Desktop/AI/bolt.new-any-llm/node_modules/.pnpm/@ai-sdk+provider-utils@1.0.20_zod@3.23.8/node_modules/@ai-sdk/provider-utils/dist/index.mjs:336:28) at async MistralChatLanguageModel.doStream (file:///C:/Users/slowp/Desktop/AI/bolt.new-any-llm/node_modules/.pnpm/@ai-sdk+mistral@0.0.43_zod@3.23.8/node_modules/@ai-sdk/mistral/dist/index.mjs:298:50) at async fn (file:///C:/Users/slowp/Desktop/AI/bolt.new-any-llm/node_modules/.pnpm/ai@3.4.9_react@18.3.1_sswr@2.1.0_svelte@4.2.18svelte@4.2.18_vue@3.4.30_typescript@5.5.2zod@3.23.8/node_modules/ai/dist/index.mjs:3938:23) at async file:///C:/Users/slowp/Desktop/AI/bolt.new-any-llm/node_modules/.pnpm/ai@3.4.9_react@18.3.1_sswr@2.1.0_svelte@4.2.18svelte@4.2.18_vue@3.4.30_typescript@5.5.2zod@3.23.8/node_modules/ai/dist/index.mjs:256:22 at async _retryWithExponentialBackoff (file:///C:/Users/slowp/Desktop/AI/bolt.new-any-llm/node_modules/.pnpm/ai@3.4.9_react@18.3.1_sswr@2.1.0_svelte@4.2.18svelte@4.2.18_vue@3.4.30_typescript@5.5.2zod@3.23.8/node_modules/ai/dist/index.mjs:86:12) at async startStep (file:///C:/Users/slowp/Desktop/AI/bolt.new-any-llm/node_modules/.pnpm/ai@3.4.9_react@18.3.1_sswr@2.1.0_svelte@4.2.18svelte@4.2.18_vue@3.4.30_typescript@5.5.2zod@3.23.8/node_modules/ai/dist/index.mjs:3903:13) at async fn (file:///C:/Users/slowp/Desktop/AI/bolt.new-any-llm/node_modules/.pnpm/ai@3.4.9_react@18.3.1_sswr@2.1.0_svelte@4.2.18svelte@4.2.18_vue@3.4.30_typescript@5.5.2zod@3.23.8/node_modules/ai/dist/index.mjs:3977:11) at async file:///C:/Users/slowp/Desktop/AI/bolt.new-any-llm/node_modules/.pnpm/ai@3.4.9_react@18.3.1_sswr@2.1.0_svelte@4.2.18svelte@4.2.18_vue@3.4.30_typescript@5.5.2zod@3.23.8/node_modules/ai/dist/index.mjs:256:22 at async chatAction (C:/Users/slowp/Desktop/AI/bolt.new-any-llm/app/routes/api.chat.ts:64:20) at async Object.callRouteAction (C:\Users\slowp\Desktop\AI\bolt.new-any-llm\node_modules.pnpm\@remix-run+server-runtime@2.10.0_typescript@5.5.2\node_modules\@remix-run\server-runtime\dist\data.js:37:16) at async C:\Users\slowp\Desktop\AI\bolt.new-any-llm\node_modules.pnpm\@remix-run+router@1.17.0\node_modules\@remix-run\router\dist\router.cjs.js:4612:21 at async callLoaderOrAction (C:\Users\slowp\Desktop\AI\bolt.new-any-llm\node_modules.pnpm\@remix-run+router@1.17.0\node_modules\@remix-run\router\dist\router.cjs.js:4677:16) at async Promise.all (index 1) at async callDataStrategyImpl (C:\Users\slowp\Desktop\AI\bolt.new-any-llm\node_modules.pnpm\@remix-run+router@1.17.0\node_modules\@remix-run\router\dist\router.cjs.js:4552:17) at async callDataStrategy (C:\Users\slowp\Desktop\AI\bolt.new-any-llm\node_modules.pnpm\@remix-run+router@1.17.0\node_modules\@remix-run\router\dist\router.cjs.js:4041:19) at async submit (C:\Users\slowp\Desktop\AI\bolt.new-any-llm\node_modules.pnpm\@remix-run+router@1.17.0\node_modules\@remix-run\router\dist\router.cjs.js:3900:21) at async queryImpl (C:\Users\slowp\Desktop\AI\bolt.new-any-llm\node_modules.pnpm\@remix-run+router@1.17.0\node_modules\@remix-run\router\dist\router.cjs.js:3858:22) at async Object.queryRoute (C:\Users\slowp\Desktop\AI\bolt.new-any-llm\node_modules.pnpm\@remix-run+router@1.17.0\node_modules\@remix-run\router\dist\router.cjs.js:3827:18) at async handleResourceRequest (C:\Users\slowp\Desktop\AI\bolt.new-any-llm\node_modules.pnpm\@remix-run+server-runtime@2.10.0_typescript@5.5.2\node_modules\@remix-run\server-runtime\dist\server.js:413:20) at async requestHandler (C:\Users\slowp\Desktop\AI\bolt.new-any-llm\node_modules.pnpm\@remix-run+server-runtime@2.10.0_typescript@5.5.2\node_modules\@remix-run\server-runtime\dist\server.js:156:18) at async C:\Users\slowp\Desktop\AI\bolt.new-any-llm\nodemodules.pnpm\@remix-run+dev@2.10.0@remix-run+react@2.10.2_react-dom@18.3.1_react@18.3.1__react@18.3.1_typ_qwyxqdhnwp3srgtibfrlais3ge\node_modules\@remix-run\dev\dist\vite\cloudflare-proxy-plugin.js:70:25 { cause: undefined, url: 'https://api.mistral.ai/v1/chat/completions', requestBodyValues: { model: 'codestral-latest', safe_prompt: undefined, max_tokens: 8000, temperature: 0, top_p: undefined, random_seed: undefined, response_format: undefined, messages: [ [Object], [Object] ], tools: undefined, tool_choice: undefined, stream: true }, statusCode: 401, responseHeaders: { 'access-control-allow-origin': '*', 'alt-svc': 'h3=":443"; ma=86400', 'cf-cache-status': 'DYNAMIC', 'cf-ray': '8e54597f7a984192-BOM', connection: 'keep-alive', 'content-length': '81', 'content-type': 'application/json; charset=utf-8', date: 'Wed, 20 Nov 2024 00:33:37 GMT', server: 'cloudflare', 'www-authenticate': 'Key', 'x-kong-request-id': 'f5931d2a40899454524adb237d07b041', 'x-kong-response-latency': '0' }, responseBody: '{\n' + ' "message":"Unauthorized",\n' + ' "request_id":"f5931d2a40899454524adb237d07b041"\n' + '}', isRetryable: false, data: undefined,

}

`

champ2050 commented 2 days ago

The issue arose because Mistral provides two separate keys: one for Codestral models and another for API models. Initially, I was using the key designated for Codestral models. After switching to the Mistral API key, the issue was resolved. Therefore, I am closing this now.