Consolidate SDK and CLI into unified vastai package#345
Conversation
Replace the monolithic vast.py with a modular package structure: - vastai/cli/ — CLI entry point, parser, and per-domain command modules - vastai/api/ — HTTP client and per-domain API functions - vastai/sdk.py — VastAI class wrapping all API functions - vastai/serverless/ — serverless client and server (unchanged) - vastai/utils.py — shared utilities Also adds: - vastai_sdk/ backward-compat shim (import vastai_sdk still works) - sdk-wrapper/ for publishing vastai-sdk PyPI package - Full test suite (401 tests) - Docker support, benchmarks, examples, docs - Two-job CI workflow (publishes vastai + vastai-sdk to PyPI) - PR test workflow with change detection Code sourced from vast-sdk combined-cli-sdk branch. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
|
This is a CLI, why are we trying to install the transformers and uvicorn packages? transformers~=4.52 Install commands after change:pip install vastai # CLI + SDK only (~30-35 packages)
pip install vastai[serverless] # CLI + SDK + serverless (~50 packages)Impact
|
|
|
@sammy-vastai mixed feelings for making serverless optional on one hand, lighter install for cli users (20 less packages) @LucasArmandVast thoughts? |
|
I'm ok either way, but just as a CC FYI Here’s your cleaned up and well-formatted version (tightened wording, consistent tables, clearer structure): Serverless Dependency ImpactThe serverless dependencies add 21 extra packages on top of the CLI-only baseline: The 6 direct serverless dependencies:
These pull in 15 additional transitive dependencies (e.g., multidict, yarl, frozenlist, aiosignal, attrs, etc.). 👉 Net effect: ~2× increase in total package count If serverless were optional ( Maintenance & CLI UtilityKey takeaways:
👉 Overall: These dependencies are well-maintained, but strongly belong in optional extras, not the core CLI install. Package Size ImpactIndividual sizes aren’t large, but they accumulate: Overall install size impact: Bottom Line
👉 Strong recommendation: |
|
This was originally all going into the vast_sdk repo, but we changed it to this repo since its more popular. This changes this repo from |
|
I think it would be a bad user experience if you The serverless packages aren't just for serverless, they are also for the new generic vast async client, which also uses aiohttp and its dependencies. |
replaces the monolithic vast.py with a modular vastai/ package.
one pip package for both the cli and sdk.
everything is backwards and forwards compatible.
splits vast.py into its own modules:
also adds:
vast.pyis still there as a deprecated shim for backwards compatibility