Skip to content

Support uv for environment setup and dependency install - #384

Merged
thomas9120 merged 2 commits into
thomas9120:mainfrom
Raymondycp:feat/uv-environment
Sep 16, 2026
Merged

thomas9120 merged 2 commits into
thomas9120:mainfrom
Raymondycp:feat/uv-environment

Conversation

@Raymondycp

Copy link
Copy Markdown
Contributor

Summary

Allow the LLama GUI venv to be created and its dependencies installed with
uv when it is available, while keeping the
existing python -m venv + pip flow as a fallback.

Changes

  • install.sh: detect uv on PATH; create the venv with
    uv venv --seed --python "$PY_CMD" and install requirements with
    uv pip install --python "$VENV_PYTHON" -r requirements.txt. Falls back to
    python -m venv / pip when uv is absent.
  • backend/services/git_update.py: new dependency_install_command()
    used by the in-app updater (install_python_dependencies). Prefers
    uv pip install --python <sys.executable> -r requirements.txt when uv is on
    PATH, else the previous sys.executable -m pip install -r requirements.txt.
  • AGENTS.md / CONTRIBUTING.md: document the uv workflow, and why
    --seed / pip-in-venv must be preserved for install.sh and the updater.

Why uv + --seed

  • uv venv without --seed produces a venv with no pip; both
    install.sh and the in-app updater assume pip exists in the venv.
  • There is no pyproject.toml, so dependencies are managed with
    uv pip install -r requirements.txt (not uv sync).

Tests

Ran with the project venv:

  • python -m unittest discover tests -v — 825 tests OK (includes two new
    tests covering the uv-preference and pip-fallback branches.
  • tests/backend/test_docs_links.py and test_docs_sync.py — OK.

Detect uv in install.sh and in the in-app updater: create the venv with
'uv venv --seed' and install requirements with 'uv pip install --python'
when uv is on PATH, falling back to the existing python -m venv / pip
flow. Document the uv workflow in AGENTS.md and CONTRIBUTING.md.
Mention uv as an automatic alternative to pip/venv in the requirements
and the manual install steps.

@thomas9120 thomas9120 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small clarification needed regarding windows install via bat file, it wouldn't use uv but the in-app updater would on Windows. I can make these changes post merge.

@thomas9120
thomas9120 merged commit bfc603b into thomas9120:main Sep 16, 2026
5 checks passed
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

Successfully merging this pull request may close these issues.

2 participants