zed icon indicating copy to clipboard operation
zed copied to clipboard

Selecting New Model doesn't do anything.

Open tempusthales opened this issue 1 year ago • 7 comments

Check for existing issues

  • [X] Completed

Describe the bug / provide steps to reproduce it

When I go into New Context, after setting up my API Keys, and try to choose a Model, nothing happens. I tried picking Claude 3.5 Sonnet - Zed and Claude 3.5 Sonnet Anthropic and nothing happens. I also tried with all the others in the drop down, I choose but nothing happens.

All I see is /default - error: Permission denied (os error 13) in red.

Above this it says No LLM Provider selected.

I use VSCode and ClaudeDev with no issues and I have all my keys added as well.

Environment

Zed: v0.150.4 (Zed) OS: macOS 15.1.0 Memory: 64 GiB Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

Zed.log

[Zed.log](https://github.com/user-attachments/files/16807001/Zed.log)

tempusthales avatar Aug 29 '24 22:08 tempusthales

I had the same problem and that was on my side. My Zed config files were managed by Nix Manager and Zed has no permissions to change them. So may be you should check your settings.json permissions and fix them.

vladimirkvnk avatar Jan 29 '25 08:01 vladimirkvnk

I've configured OpenAI and ollama using the UI but was still getting "No LLM Provider selected". It worked after editing settings.json directly and adding this:

"assistant": {
  "version": "2",
  "enabled": true,
  "default_model": {
    "provider": "ollama",
    "model": "deepseek-r1"
  }
},

pdandradeb avatar Feb 17 '25 13:02 pdandradeb

I just ran into this same issue using home-manager to configure zed. If I remove the link to the nix store for my settings and restart, everything starts working. Otherwise, I tried to put in the default config for the assistant and it still didn't work. It seems like settings.json needs to be writeable, otherwise I can't get the model switcher to work. It will select the default model from my config, but then I can't switch to anything else

thomastaylor312 avatar Mar 26 '25 07:03 thomastaylor312

I'm having the same issue as @thomastaylor312 thanks for the explanation, I was completely lost, but what you say makes a lot of sense 😅

It would be nice if it can switch in memory + write the default value to the settings. This would mean that for nix user, changing the default provider would work, but it wouldn't be persisted. I'd be fine with that.

woile avatar Apr 11 '25 15:04 woile

I would like to work on this issue. I'm not sure who to tag. Maybe @agu-z ?

I read a bit the code, and the following is what I think a possible solution:

I think LanguageModelRegistry should have a new attribute: active_model, instead of using default_model. And the the trait should attempt to set default_model on model selection, but the application should use active_model instead, which would live in memory.

woile avatar Apr 12 '25 15:04 woile

@woile Going to take a guess that since this is open for a bit, it is probably fine to work on. But, not a maintainer so totally just a guess!

thomastaylor312 avatar Apr 16 '25 06:04 thomastaylor312

@woile says:

I think LanguageModelRegistry should have a new attribute: active_model, instead of using default_model. And the the trait should attempt to set default_model on model selection, but the application should use active_model instead, which would live in memory.

And just to add my two cents: I'm all for the active_model principle, which should furthermore be assistant panel specific (see #23484). In fact I don't get why Zed is trying to change the default_model configuration when selecting one of the pre-configured models: switching between models do not signal a user intent to change his defaults imo.

For example, there is a cost-optimisation use-case. Claude 3.5 is cheap compared to 3.7, and 3.5 is enough for most tasks => makes sense to have it as a default. At the same time, having the ability to switch to 3.7 for a more complex task is useful. But it clearly does not mean the user want to change its default.

JeremieRodon avatar Apr 30 '25 07:04 JeremieRodon

I think this has been fixed (not by me).

woile avatar May 17 '25 18:05 woile

Ironically though, in the new agent mode, if I try to select the mode (i.e. "write" "ask" etc), the logs complain about not being able to write to a file

thomastaylor312 avatar May 20 '25 03:05 thomastaylor312

Hey folks, I'm closing this issue as it doesn't seem to be a problem anymore; I couldn't personally reproduce it. As this issue is also quite old at this point, I'd kindly ask for a new issue if the problem by any chance still persists, attaching reproduction steps and env information. Thanks so much!

danilo-leal avatar May 28 '25 16:05 danilo-leal