Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

llm loses track of plugins when upgraded (with uv) #575

Open
noamross opened this issue Sep 15, 2024 · 1 comment
Open

llm loses track of plugins when upgraded (with uv) #575

noamross opened this issue Sep 15, 2024 · 1 comment

Comments

@noamross
Copy link

This may not be an llm issue, but could have to do with the interaction of the plugin mechanism with python packaging tooling.

I have llm installed (on MacOS) via uv tool install llm. When I update llm with uv tool upgrade llm, it forgets about all of its installed plugins:

~ > llm plugins                                                                                                                                                                                                                                                                                                                                          
[
  {
    "name": "llm-claude-3",
    "hooks": [
      "register_models"
    ],
    "version": "0.4.1"
  },
  {
    "name": "llm-llamafile",
    "hooks": [
      "register_models"
    ],
    "version": "0.1"
  },
  {
    "name": "llm-perplexity",
    "hooks": [
      "register_models"
    ],
    "version": "0.9"
  },
  {
    "name": "llm-ollama",
    "hooks": [
      "register_commands",
      "register_models"
    ],
    "version": "0.5.0"
  },
  {
    "name": "llm-cmd",
    "hooks": [
      "register_commands"
    ],
    "version": "0.2a0"
  },
  {
    "name": "llm-claude",
    "hooks": [
      "register_models"
    ],
    "version": "0.4.0"
  },
  {
    "name": "llm-mistral",
    "hooks": [
      "register_commands",
      "register_embedding_models",
      "register_models"
    ],
    "version": "0.5"
  }
]

Now I update:

~ > uv tool upgrade llm                                                                                                                                                                                                                                                                                                                                   
Modified llm environment
 - anthropic==0.34.2
 - charset-normalizer==3.3.2
 - filelock==3.16.0
 - fsspec==2024.9.0
 - httpx-sse==0.4.0
 - huggingface-hub==0.24.7
 - llm-claude==0.4.0
 - llm-claude-3==0.4.1
 - llm-cmd==0.2a0
 - llm-llamafile==0.1
 - llm-mistral==0.5
 - llm-ollama==0.5.0
 - llm-perplexity==0.9
 - ollama==0.3.3
 - packaging==24.1
 - prompt-toolkit==3.0.47
 - pygments==2.18.0
 - requests==2.32.3
 - tokenizers==0.20.0
 - urllib3==2.2.3
 - wcwidth==0.2.13

Now, no more plugins

~ > llm plugins                                                                                                                                                                                                                                                                                                                                           
[]

Having saved the JSON of plugins, I can re-install them, and it appears that everything is installed from the cache. Is this because llm install is using pip or something similar, and uv handles things differently?

@tspng
Copy link

tspng commented Sep 16, 2024

You are right, llm installs plugins with pip into the same environment it runs in. uv does not know about these dependencies and will remove them when upgrading the llm package.

A workaround is to install llm plugins as additional Python dependencies with uv tool install --extra <llm-plugin> llm, as documented here.
One caveat though, you cannot add additional dependencies this way. You always have to provide the full list of extra dependencies with multiple --extra options.

EDIT: fix uv tool install command

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants