continuedev / continue

⏩ Continue is the leading open-source AI code assistant. You can connect any models and any context to build custom autocomplete and chat experiences inside VS Code and JetBrains
https://docs.continue.dev/
Apache License 2.0
18.91k stars 1.6k forks source link

Codestral madness - need a replacement default config.json #1769

Open sid-newby opened 3 months ago

sid-newby commented 3 months ago

Before submitting your bug report

Relevant environment info

- OS: Mac 14.5 Sonoma
- Continue: Current + pre
- IDE: vsCode
- Model: Codestral
- config.json:

I wish..

Description

I have a paid Mistral API account. I logged into 'Le Platformme' and grabbed a Codestral API key. Added it to Continue. Immediately started getting popups on each keystroke: 401, not authorized. Double, triple checked my api key, no extra whitespaces, whole key captured, wouldnt stop. Removed the configuration from my json for Codestral, still doing it. Uninstalled Continue. Shut down vscode. Reopened, reinstalled. Same issue. every keystroke a popup 401 codestral not authorized. Switched to pre-release Continue. Same thing. Uninstalled vscode. Downloaded new, reinstalled. Installed Continue... Same thing. Insanity sets in... rm -rf ~/Library/Caches/com.microsoft.VSCode/ rm -rf ~/Library/Preferences/com.microsoft.VSCode* rm -rf ~/Library/Application\ Support/Code/ sudo rm -rf /Applications/Visual\ Studio\ Code.app rm -rf ~/APPDATA/Roaming/Code rm ~/.vscode Downloaded new binary. Installed. Installed Continue Continue will not initialize. Continue Settings / defaults json is empty.

Nothing I do will bring it back. Cannot find a copy of it anywhere. The spec you guys provide is like 2500+ lines. I need to get back to stock and I cant figure out how. Im losing my shit.

Help me out?

To reproduce

I have no clue. Maybe start with a witch.

Log output

No response

Patrick-Erichsen commented 3 months ago

Hi @sid-newby , it sounds like you're trying to recover a config.json that you accidentally deleted? If so, we don't cache the file unfortunately since it contains sensitive information such as API keys.

Regarding the 401 error, do you recall if your config looked similar to what is outlined in https://docs.continue.dev/walkthroughs/set-up-codestral ?

nzben commented 3 months ago

I'm not sure this is a config issue. I'm having an identical issue and cannot get autocomplete to do anything other than return a 401. I wonder if Codestral has a problem on their end?

My config is stock-standard, freshly installed, using the recommended config from here, and I cannot get it to work

{
  "models": [
    {
      "title": "Codestral",
      "provider": "mistral",
      "model": "codestral-latest",
      "apiKey": "[valid key is here]",
      "apiBase": "https://codestral.mistral.ai/v1/"
    }
  ],
  "customCommands": [
    {
      "name": "test",
      "prompt": "{{{ input }}}\n\nWrite a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.",
      "description": "Write unit tests for highlighted code"
    }
  ],
  "tabAutocompleteModel": {
    "title": "Codestral",
    "provider": "mistral",
    "model": "codestral-latest",
    "apiKey": "[valid key]",
    "apiBase": "https://codestral.mistral.ai/v1/"
  },
  "allowAnonymousTelemetry": true,
  "embeddingsProvider": {
    "provider": "openai",
    "model": "voyage-code-2",
    "apiBase": "https://api.voyageai.com/v1/",
    "apiKey": "[another valid key]"
  },
  "reranker": {
    "name": "voyage",
    "params": {
      "apiKey": "[and another key same as above]"
    }
  }
}

CleanShot 2024-07-24 at 09 59 24@2x

nzben commented 3 months ago

OMG. I am an idiot. I didn't realise there was a separate part in Mistral where you have to explicitly enable Codestral and get a separate key for it.

thorvaldur-arnar commented 3 months ago

It wasn’t obvious to me either.

odupuy commented 3 months ago

Yes, you have to enable codestral on https://console.mistral.ai/codestral in addition to the API key