Skip to content

feat(bundles): add torch-free all-no-torch extra to lfx-bundles#13886

Open
jordanrfrazier wants to merge 11 commits into
release-1.11.0from
lfx-bundles-all-no-torch-extra
Open

feat(bundles): add torch-free all-no-torch extra to lfx-bundles#13886
jordanrfrazier wants to merge 11 commits into
release-1.11.0from
lfx-bundles-all-no-torch-extra

Conversation

@jordanrfrazier

@jordanrfrazier jordanrfrazier commented Jun 28, 2026

Copy link
Copy Markdown
Collaborator

lfx[bundles] resolves to lfx-bundles[all], which pulls torch via the cuga and codeagents providers. Add a generated all-no-torch aggregate (all minus those two, 70 of 72 providers) so slim/CPU images can install the full provider set without torch. Generated by consolidate_bundles.py via the new TORCH_EXTRAS set; bump lfx-bundles 1.0.0 -> 1.1.0.

Add a guard test that re-resolves lfx-bundles[all-no-torch] and fails if any torch-family distribution appears, catching providers that pull torch transitively (e.g. via langchain/sentence-transformers) on future updates.

Summary by CodeRabbit

  • New Features

    • Added a new all-no-torch install option for the bundle, making it easier to install the full set of extras without torch-related dependencies.
    • Updated the bundle metadata to clearly describe both all and all-no-torch options.
  • Bug Fixes

    • Regenerates the torch-free aggregate consistently during bundle updates.
    • Added checks to ensure the new install option stays free of torch-family packages.
lfx[bundles] resolves to lfx-bundles[all], which pulls torch via the cuga
and codeagents providers. Add a generated all-no-torch aggregate (all minus
those two, 70 of 72 providers) so slim/CPU images can install the full
provider set without torch. Generated by consolidate_bundles.py via the new
TORCH_EXTRAS set; bump lfx-bundles 1.0.0 -> 1.1.0.

Add a guard test that re-resolves lfx-bundles[all-no-torch] and fails if any
torch-family distribution appears, catching providers that pull torch
transitively (e.g. via langchain/sentence-transformers) on future updates.
@jordanrfrazier jordanrfrazier requested a review from erichare June 28, 2026 19:53
@coderabbitai

coderabbitai Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c42a5241-6b4a-47cc-a358-8493ceb4976a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch lfx-bundles-all-no-torch-extra

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jordanrfrazier jordanrfrazier marked this pull request as ready for review June 28, 2026 19:53
@github-actions github-actions Bot added the enhancement New feature or request label Jun 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

✅ Test Coverage Advisor

No source changes detected without accompanying tests. Thanks for keeping coverage up! 🎉

Advisory check only — never blocks merge.

@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jun 28, 2026
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jun 28, 2026
@codecov

codecov Bot commented Jun 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.62%. Comparing base (fa78cdd) to head (1dab9de).
⚠️ Report is 1 commits behind head on release-1.11.0.

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                 @@
##           release-1.11.0   #13886      +/-   ##
==================================================
+ Coverage           59.58%   59.62%   +0.04%     
==================================================
  Files                2349     2349              
  Lines              224820   224820              
  Branches            33523    33471      -52     
==================================================
+ Hits               133954   134059     +105     
+ Misses              89347    89242     -105     
  Partials             1519     1519              
Flag Coverage Δ
backend 67.26% <ø> (-0.10%) ⬇️
frontend 58.39% <ø> (+0.09%) ⬆️
lfx 56.47% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 34 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/bundles/lfx-bundles/tests/test_all_no_torch_extra.py`:
- Around line 117-118: The guard in the test helper that runs uv pip compile is
treating every non-zero exit as an offline/registry issue, which hides real
resolver problems. Update the failure handling in the compile check so it only
calls pytest.skip for clearly transient environment failures (for example,
network/registry unavailability) and uses pytest.fail for unexpected resolver
errors such as invalid extras or dependency conflicts. Keep the logic localized
around the subprocess returncode handling in test_all_no_torch_extra.py so the
test still verifies the real behavior instead of masking failures.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
���️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 92e6e42c-608f-499e-8391-fa30133019f6

📥 Commits

Reviewing files that changed from the base of the PR and between fa78cdd and 3fc445a.

📒 Files selected for processing (3)
  • scripts/migrate/consolidate_bundles.py
  • src/bundles/lfx-bundles/pyproject.toml
  • src/bundles/lfx-bundles/tests/test_all_no_torch_extra.py
Comment on lines +117 to +118
if proc.returncode != 0:
pytest.skip(f"could not resolve all-no-torch (offline / registry unavailable?):\n{proc.stderr[-800:]}")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Don't skip every failed resolve.

Any non-zero uv pip compile exit currently turns this guard green, so an invalid extra or dependency conflict is indistinguishable from “offline/registry unavailable.” Only skip known transient environment failures; unexpected resolver errors should pytest.fail(...).

Suggested fix
     if proc.returncode != 0:
-        pytest.skip(f"could not resolve all-no-torch (offline / registry unavailable?):\n{proc.stderr[-800:]}")
+        stderr = proc.stderr.lower()
+        transient_markers = (
+            "offline",
+            "registry unavailable",
+            "temporary failure",
+            "timed out",
+            "connection",
+            "network",
+            "dns",
+            "tls",
+            "certificate",
+        )
+        if any(marker in stderr for marker in transient_markers):
+            pytest.skip(f"could not resolve all-no-torch (offline / registry unavailable?):\n{proc.stderr[-800:]}")
+        pytest.fail(f"uv failed to resolve all-no-torch:\n{proc.stderr[-800:]}")

As per coding guidelines, "verify the tests actually cover the new or changed behavior rather than acting as placeholders."

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if proc.returncode != 0:
pytest.skip(f"could not resolve all-no-torch (offline / registry unavailable?):\n{proc.stderr[-800:]}")
if proc.returncode != 0:
stderr = proc.stderr.lower()
transient_markers = (
"offline",
"registry unavailable",
"temporary failure",
"timed out",
"connection",
"network",
"dns",
"tls",
"certificate",
)
if any(marker in stderr for marker in transient_markers):
pytest.skip(f"could not resolve all-no-torch (offline / registry unavailable?):\n{proc.stderr[-800:]}")
pytest.fail(f"uv failed to resolve all-no-torch:\n{proc.stderr[-800:]}")
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/bundles/lfx-bundles/tests/test_all_no_torch_extra.py` around lines 117 -
118, The guard in the test helper that runs uv pip compile is treating every
non-zero exit as an offline/registry issue, which hides real resolver problems.
Update the failure handling in the compile check so it only calls pytest.skip
for clearly transient environment failures (for example, network/registry
unavailability) and uses pytest.fail for unexpected resolver errors such as
invalid extras or dependency conflicts. Keep the logic localized around the
subprocess returncode handling in test_all_no_torch_extra.py so the test still
verifies the real behavior instead of masking failures.

Source: Coding guidelines

@github-actions

github-actions Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Frontend Unit Test Coverage Report

Coverage Summary

Lines Statements Branches Functions
Coverage: 44%
44.51% (60131/135076) 69.29% (8176/11798) 42.78% (1356/3169)

Unit Test Results

Tests Skipped Failures Errors Time
5096 0 💤 0 ❌ 0 🔥 14m 41s ⏱️

@erichare erichare left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM @jordanrfrazier , a couple small comments but not blockers. Maybe look at them and the code rabbit comments but this is much needed to have a torchless “full” install.

Findings
1. scripts/migrate/consolidate_bundles.py:182 — Comment references a non-existent all-torch aggregate. The new comment reads “Excluded from the generated all-torch aggregate so it resolves torch-free.” There is no all-torch extra; the providers in TORCH_EXTRAS are excluded from all-no-torch. A future maintainer reading this could be misled about which aggregate the exclusion applies to. Should read all-no-torch.
2. src/bundles/lfx-bundles/tests/test_all_no_torch_extra.py:108 — The “real guard” resolution test skips on any non-zero exit, so a genuine torch regression can pass silently. test_all_no_torch_resolves_without_torch calls pytest.skip(...) whenever proc.returncode != 0. The intent (per the docstring) is to tolerate offline/registry-unavailable CI, but a non-zero exit can also mean a real resolution conflict — including one introduced by the very provider change this test is meant to catch. The torch assertion only runs on a clean exit, so in a CI environment where this resolve doesn’t fully succeed, the guard is effectively a no-op and goes green. This is an intentional tradeoff, but worth confirming the guard actually runs (not just skips) in CI — otherwise the structural test is the only real protection. Consider logging/surfacing skips so a perpetually-skipped guard is visible.

@github-actions github-actions Bot added the lgtm This PR has been approved by a maintainer label Jun 29, 2026
Benchmark harness used to measure lfx cold start and the planned TRM
fork-from-warm path: forkserver_bench.py (cold/warm/concurrency/sustained/
ramp modes), Dockerfile.bench, the prewarm shim, and sample flows
(no-LLM inputoutput, model flow, two CPU-intensive agent flows). Rough WIP;
flow api_key fields are blank (read OPENAI_API_KEY from env at runtime).
Address CodeRabbit review on #13886: the resolution guard skipped on any
non-zero uv pip compile exit, so an invalid extra or a torch-introducing
dependency conflict would turn the test green. Skip only on transient
network/registry failures; pytest.fail on unexpected resolver errors.
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jun 29, 2026
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jun 29, 2026
…torch aggregate

- forkserver_bench.py: split two D205 multi-line summaries and one E501
- test_lfx_bundles_extras.py: exclude both generated aggregates (all,
  all-no-torch) from the per-provider drift checks and add an explicit
  guard that all-no-torch == all minus TORCH_EXTRAS (cuga, codeagents)
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jun 29, 2026
…mment

Leftover from the all-torch -> all-no-torch rename; the comment referenced a
non-existent all-torch aggregate. No behavior change.
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jun 29, 2026
scripts/bench/* was unrelated scope creep on this bundle PR; remove it.
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jun 29, 2026
Default `pip install langflow` no longer pulls torch. Two changes flip the
default, plus the collateral fixes the flip requires:

- langflow now depends on lfx-bundles[all-no-torch] instead of [all], dropping
  the torch-pulling bundle providers (cuga, codeagents) from the default install.
- Remove the torch-pulling extras (cuga, docling, easyocr, opendsstar) from
  langflow-base[complete]. Their definitions remain, so each installs on demand;
  the File component's docling path is opt-in via `pip install "langflow[docling]"`.

Collateral:
- Declare openpyxl as a hard lfx dependency. It backs the File/Save-File .xlsx
  read/write path (pd.read_excel / to_excel(engine="openpyxl")) but was reachable
  only transitively via docling-slim -- without this the xlsx path breaks once
  docling becomes opt-in.
- Regenerate uv.lock so the default resolution actually drops torch. Verified:
  `uv export --no-dev` resolves 0 torch packages and includes openpyxl (578 pkgs,
  down from ~689).
- Update docs that claimed `pip install langflow` is the everything-included install.

Builds on the lfx-bundles[all-no-torch] aggregate (#13886).

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jun 29, 2026
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jun 29, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jun 29, 2026
@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Build successful! ✅
Deploying docs draft.
Deploy successful! View draft

@jordanrfrazier jordanrfrazier added the DO NOT MERGE Don't Merge this PR label Jun 29, 2026
@erichare erichare requested a review from mendonk June 29, 2026 18:16
@jordanrfrazier jordanrfrazier removed the DO NOT MERGE Don't Merge this PR label Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer

2 participants