docs: update local copilot instructions for macOS (#1077)

* docs: update local copilot instructions for macOS
* docs: add source and more detailed instructions for Ollama setup instructions
This commit is contained in:
Josh Medeski 2025-01-22 16:51:34 -06:00 committed by GitHub
parent 49fee3a175
commit b19671b39a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -43,12 +43,32 @@ Look for this parameter `llama_new_context_with_model: n_ctx` in your server log
#### Start Ollama server for Obsidian
In order for Obsidian to communicate with Ollama, the `OLLAMA_ORIGINS` variable needs to be updated. Choose your method for running Ollama to get detailed instructions for how to update Ollama correctly.
<details>
<summary>CLI</summary>
Now, **start the local server with `OLLAMA_ORIGINS=app://obsidian.md* ollama serve`, this will allow the Obsidian app to access the local server without CORS issues**.
> **NOTE**: If using `fish`, quote the env value: `OLLAMA_ORIGINS="app://obsidian.md*" ollama serve`
Again, `OLLAMA_ORIGINS=app://obsidian.md*` is required!
</details>
<details>
<summary>macOS App</summary>
If Ollama is run as a macOS application, [environment variables should be set using launchctl](https://github.com/Ollama/Ollama/blob/main/docs/faq.md#setting-environment-variables-on-mac). To support Obsidian, set "app://obsidian.md*" on the `OLLAMA_ORIGINS` variable by running this command:
```sh
launchctl setenv OLLAMA_ORIGINS "app://obsidian.md*"
```
Then, quit Ollama from the menu bar and reopen it.
</details>
<img src="./images/ollama-serve.png" alt="Ollama">
Inside Copilot settings, click Add Custom Model, enter the model name you pulled from Ollama, e.g. `mistral`, select `ollama` as provider, click add, and you'll find it in your model picker!