Skip to main content

A plugin for LLM that enables proper plugin management when installed via uv tool.

Project description

llm-uv-tool

PyPI PyPI - Python Version

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 install
  • llm 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:

  1. Install llm-uv-tool in your current LLM environment:

    llm install llm-uv-tool
    
  2. Copy all installed plugins to uv-tool-packages.json in 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"
    
  3. 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:

  1. Tracking which plugins you've installed
  2. Ensuring those plugins are preserved when installing/uninstalling
  3. Providing a consistent installation experience that works with uv's tool system
  4. 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

llm_uv_tool-0.1.2.tar.gz (38.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llm_uv_tool-0.1.2-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

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

Hashes for llm_uv_tool-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f25ce6a15d5d61988879131044fd90b0d15df6c702d61b1bfaff78646d68cd93
MD5 555ff6256f7868afab6ed86757b133ba
BLAKE2b-256 829ae7f03e1b95308926c0a61de83fff6ea1f15f259cbdf77af30373547e9375

See more details on using hashes here.

File details

Details for the file llm_uv_tool-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for llm_uv_tool-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 972b280411fb674599288b10e5da10de3493cb8dfdac9b8aa8194cefca3273e1
MD5 3f895ba5e6ac172713549c4ce18ae069
BLAKE2b-256 c2cec37f80daafeb9d84656817fb84153e175189447a9fb63e91aa49c5745bf4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page