feat(DAH-2254): surface GPU splitting in lium CLI/SDK - #93
Open
fortunelucky777 wants to merge 2 commits into
Open
feat(DAH-2254): surface GPU splitting in lium CLI/SDK#93fortunelucky777 wants to merge 2 commits into
fortunelucky777 wants to merge 2 commits into
Conversation
- ExecutorInfo: add min_gpu_count_for_rental and available_gpu_count fields - _dict_to_executor_info: wire both new fields from API dict - _is_splittable_for_count: module-level predicate helper (parity with FE) - Lium.ls(): add widen_for_splitting kwarg (default False per D2a) - decorators.py: clarifying comment — @machine stays strict - cli/ls/actions.py: pass widen_for_splitting=True (CLI opt-in only) - cli/ls/command.py: update --count help string - cli/ls/display.py: append '↯ from N' in _cfg, add field to compact_executor
- test/fixtures/splittable_executors.json: byte-identical twin of frontend fixture - test/test_client_ls_widen.py: 5 tests covering widen truth table, default-off, compact_executor field round-trip, and _cfg '↯ from N' marker
fortunelucky777
force-pushed
the
feat/DAH-2254-sdk-widen-opt-in
branch
from
July 29, 2026 14:46
489757e to
38c59db
Compare
6 tasks
fortunelucky777
requested review from
arhangel66,
pixel29913 and
taiberium
and removed request for
arhangel66
August 6, 2026 13:55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DAH-2254 — Surface GPU splitting in lium CLI/SDK
Summary
ExecutorInfoPydantic model gainsmin_gpu_count_for_rental: int | Noneandavailable_gpu_count: int | None. Both pre-existing on the backend payload — this PR just deserializes them.Client.ls(widen_for_splitting: bool = False)— opt-in widen. When True withgpu_count=Nset, also returns splittable nodes wheremin_gpu_count_for_rental ≤ N ≤ available_gpu_count. Default OFF preserves SDK semver — third-party agent code that callsLium().ls(gpu_count=1)keeps strict semantics.lium ls --count N(the user-facing CLI) passeswiden_for_splitting=Trueso the marketplace UI and the CLI agree.@machine("XxY")decorator unchanged — it callssdk.ls()with no kwargs at `decorators.py:49`, so the widen path never fires. A comment block at `decorators.py:43-48` documents this for future editors.↯ from Nsuffix on splittable rows (mirrors the existing(DinD)suffix pattern).lium ls --format jsonexposesmin_gpu_count_for_rentalso AI-agent consumers can decide programmatically.pyproject.toml+lium/__about__.py(release workflow cross-checks).Files
lium/sdk/models.py— two new optional fields onExecutorInfolium/sdk/client.py—_is_splittable_for_countpredicate helper (reciprocal-parity comment with frontend) +widen_for_splittingkwarg + payload deserialization in_dict_to_executor_infolium/sdk/decorators.py— clarifying comment abovesdk.ls()calllium/cli/ls/actions.py— CLI passeswiden_for_splitting=Truelium/cli/ls/command.py—--counthelp text updatedlium/cli/ls/display.py— Rich-table marker + JSON fieldpyproject.toml,lium/__about__.py— version bumptest/fixtures/splittable_executors.json(new) — shared fixture (byte-identical with frontend repo)test/test_client_ls_widen.py(new) — 5 tests covering widen=True/False, default-off invariant, JSON field, Rich-table markerAcceptance criteria
ExecutorInfo.min_gpu_count_for_rental+available_gpu_countpopulated from APIlium lstable marks splittable rows with `↯ from N`lium ls --format jsonincludesmin_gpu_count_for_rentallium ls --count Nwidens to splittable; positive test covers widen=True/False@machinedecorator stays strict (no kwargs tosdk.ls(); default-off invariant asserted byinspect.signaturetest)pyproject.toml:7andlium/__about__.py:3both at `0.0.25`Test plan
lium ls --count 1returns native 1xGPU + splittable bigger nodes with min ≤ 1;lium ls --format json | jq '.[0].min_gpu_count_for_rental'returns the value.Companion PR
Datura-ai/lium-io-frontend#204 — `feat/2254-gpu-splitting-filter` surfaces the same signal in the marketplace UI. The frontend's `matchesGpuCountFilter` predicate and this PR's `_is_splittable_for_count` predicate share a byte-identical JSON fixture; reciprocal code comments at `PodFiltersProvider.tsx` and `client.py` link them.
Source artifacts
Notes for reviewer
Client.ls()default OFF is deliberate. SDK consumers that callLium().ls(gpu_count=1)programmatically (AI agents per spec) get the same result-set as before this PR. Onlylium lsopts in; only the CLI passeswiden_for_splitting=True.gpu_count=...to thesdk.ls()call indecorators.py, decide explicitly aboutwiden_for_splitting— the comment block flags this.test/fixtures/splittable_executors.json(mirrored atsrc/contexts/__fixtures__/splittable-executors.jsonin the frontend repo). Any change to one must be made byte-for-byte to the other; Gate C diff catches drift.