Homebrew PyTorch warning, closes #397

This commit is contained in:
Simon Willison 2024-01-26 13:59:27 -08:00
parent 46763326ed
commit 2b92756046
2 changed files with 25 additions and 3 deletions

View file

@ -25,15 +25,19 @@ For more check out [the llm tag](https://simonwillison.net/tags/llm/) on my blog
## Quick start
First, install LLM using `pip` or Homebrew:
First, install LLM using `pip` or Homebrew or `pipx`:
```bash
pip install llm
```
Or with Homebrew:
Or with Homebrew (see {ref}`warning note <homebrew-warning>`):
```bash
brew install llm
```
Or with [pipx](https://pypa.github.io/pipx/):
```bash
pipx install llm
```
If you have an [OpenAI API key](https://platform.openai.com/api-keys) key you can run this:
```bash
# Paste your OpenAI API key into this

View file

@ -10,7 +10,7 @@ Or using [pipx](https://pypa.github.io/pipx/):
```bash
pipx install llm
```
Or using [Homebrew](https://brew.sh/):
Or using [Homebrew](https://brew.sh/) (see {ref}`warning note <homebrew-warning>`):
```bash
brew install llm
```
@ -34,6 +34,24 @@ If the latest version is not yet available on Homebrew you can upgrade like this
llm install -U llm
```
(homebrew-warning)=
## A note about Homebrew and PyTorch
The version of LLM packaged for Homebrew currently uses Python 3.12. The PyTorch project do not yet have a stable release of PyTorch for that version of Python.
This means that LLM plugins that depend on PyTorch such as [llm-sentence-transformers](https://github.com/simonw/llm-sentence-transformers) may not install cleanly with the Homebrew version of LLM.
You can workaround this by manually installing PyTorch before installing `llm-sentence-transformers`:
```bash
llm install llm-python
llm python -m pip install \
--pre torch torchvision \
--index-url https://download.pytorch.org/whl/nightly/cpu
llm install llm-sentence-transformers
```
This should produce a working installation of that plugin.
## Installing plugins
{ref}`plugins` can be used to add support for other language models, including models that can run on your own device.