A plugin for LLM that enables proper plugin management when installed via uv tool.
Project description
llm-uv-tool
A plugin for LLM that provides integration when installing LLM as a uv tool.
Requirements
- Python 3.10, 3.11, 3.12, 3.13
- uv
Installation
uv tool install --with llm-uv-tool llm
Usage
This plugin overrides two built-in LLM commands:
llm installllm uninstall
Once llm-uv-tool is installed as a plugin in your LLM environment, its commands will run instead of the built-in so your usage should stay the same as before.
These modified commands are wrappers around uv tool install with appropriate flags instead of pip, maintaining a list of installed plugins to ensure they're properly managed within uv's environment.
To install a plugin:
llm install llm-ollama
To uninstall a plugin:
llm uninstall llm-openrouter
Both llm-uv-tool commands take the same arguments as the built-in LLM commands, which map to pip's install and uninstall commands
llm install --force-reinstall llm-gpt4all
llm uninstall -y llm-gpt4all
The plugin maintains a list of installed packages in a JSON file located in your LLM config directory (typically ~/.config/io.datasette.llm/uv-tool-packages.json, though the location may vary depending on your OS). This file contains a simple JSON array with an entry for each installed plugin:
[
"llm-anthropic",
"llm-ollama",
"llm-uv-tool"
]
When you install or uninstall plugins, this file is automatically updated to track your changes.
Migrating to llm-uv-tool
If you're already using LLM with other plugins and want to migrate to using llm-uv-tool, follow these steps:
-
Install llm-uv-tool in your current LLM environment:
llm install llm-uv-tool
-
Copy all installed plugins to
uv-tool-packages.jsonin your LLM config directory.For a small number of plugins, you may want to just create this file by hand. If you would rather use jq to automate the process, this command should do the trick:
llm plugins | jq "[.[].name]" > "$XDG_CONFIG_HOME/io.datasette.llm/uv-tool-packages.json"
-
To verify everything is working, you can add an additional plugin and check the contents of
uv-tool-packages.json.llm install llm-templates-github
After you run this command it should look something like this, with llm-templates-github at the end:
[ "llm-anthropic", "llm-uv-tool", "llm-templates-github" ]
Why use this?
When you install LLM as a standalone CLI tool using uv's tool feature (uv tool install llm), the standard plugin installation mechanism (which uses pip) doesn't play well with uv's isolated environment approach.
This plugin attempts to solve that problem by:
- Tracking which plugins you've installed
- Ensuring those plugins are preserved when installing/uninstalling
- Providing a consistent installation experience that works with uv's tool system
- Maintaining the same API and user experience as the built-in LLM install/uninstall commands
Using this plugin helps ensure your LLM plugins remain properly installed when using uv's tool system.
License
llm-uv-tool is licensed under the MIT license. See the LICENSE file for more information.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llm_uv_tool-0.1.2.tar.gz.
File metadata
- Download URL: llm_uv_tool-0.1.2.tar.gz
- Upload date:
- Size: 38.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f25ce6a15d5d61988879131044fd90b0d15df6c702d61b1bfaff78646d68cd93
|
|
| MD5 |
555ff6256f7868afab6ed86757b133ba
|
|
| BLAKE2b-256 |
829ae7f03e1b95308926c0a61de83fff6ea1f15f259cbdf77af30373547e9375
|
File details
Details for the file llm_uv_tool-0.1.2-py3-none-any.whl.
File metadata
- Download URL: llm_uv_tool-0.1.2-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
972b280411fb674599288b10e5da10de3493cb8dfdac9b8aa8194cefca3273e1
|
|
| MD5 |
3f895ba5e6ac172713549c4ce18ae069
|
|
| BLAKE2b-256 |
c2cec37f80daafeb9d84656817fb84153e175189447a9fb63e91aa49c5745bf4
|