Vast.ai provisioner broken with vastai-sdk 1.0.3
Bug
The Vast.ai provisioner fails to launch instances when using vastai-sdk>=1.0.0 (tested with 1.0.3).
The vastai-sdk package had a breaking rewrite in 1.0.0. The old SDK (0.2.5) exposed VastAI.api_key_access and accepted direct/ssh kwargs in create_instance(). The new SDK (1.0.3) moved the API key to VastAI.client.api_key, removed api_key_access, and dropped the direct/ssh parameters from create_instance() (replaced by runtype).
Errors
'VastAI' object has no attribute 'api_key_access'— fromsky/provision/vast/utils.pyline that writes the API key to the instance viaonstart_cmd.create_instance() got an unexpected keyword argument 'direct'—direct=Trueandssh=Trueare no longer accepted by the new SDK'screate_instance(). They need to be replaced withruntype='ssh'.The new
vastai1.0.3 CLI also stores the API key in a different location (~/.config/vastai/vast_api_key) than wherevastai-sdklooks (~/.vast_api_key), causing 403 errors even when credentials are configured.
Environment
skypilot-nightly==1.0.0.dev20260415vastai==1.0.3/vastai-sdk==1.0.3- Python 3.12, Linux
Workaround
Pin vastai>=0.2.8,<1.0 and skypilot-nightly<=1.0.0.dev20260326 to use the old compatible SDK.
Suggested fix
In sky/provision/vast/utils.py:
- Replace
vast.vast().api_key_accesswithvast.vast().client.api_key(or handle both) - Replace
launch_params['direct'] = True/launch_params['ssh'] = Truewithlaunch_params['runtype'] = 'ssh' - Pin or gate on
vastai-sdkversion if needed
Source: skypilot-org/skypilot