zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
39.58k stars 2.07k forks source link

Not accept "ollama" as assistant API key #13811

Open GitHubGeek opened 4 days ago

GitHubGeek commented 4 days ago

Check for existing issues

Describe the bug / provide steps to reproduce it

Following the doc to use locally run ollama as assistant: https://zed.dev/docs/assistant-panel#using-ollama-on-macos

Zed refuses to connect to ollama as per error below:

image

Environment

Zed: v0.142.4 (Zed) OS: macOS 14.5.0 Memory: 32 GiB Architecture: aarch64

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

No response

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

Zed.log


amtoaer commented 4 days ago

It appears that api_url is not set correctly. This error indicates that Zed is attempting to access the official OpenAI API using "ollama" as the key. Additionally, the documentation is currently outdated and needs to be updated to reflect the current changes. Since #12902 has been merged, we can now simplify the configuration for ollama as follows:

"assistant": {
    "version": "1",
    "provider": {
      "name": "ollama"
    }
}