Skip to content

Commit

Permalink
Homebrew PyTorch warning, closes #397
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Jan 26, 2024
1 parent 4676332 commit 2b92756
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
8 changes: 6 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 19 additions & 1 deletion docs/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand All @@ -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.
Expand Down

0 comments on commit 2b92756

Please sign in to comment.