diff --git a/mkdocs/docs/concepts/backends.md b/mkdocs/docs/concepts/backends.md index df1d4820b..55b8f6723 100644 --- a/mkdocs/docs/concepts/backends.md +++ b/mkdocs/docs/concepts/backends.md @@ -870,13 +870,16 @@ projects: ??? info "Capacity advisor" - By default, dstack does not check GPU availability or quota. To show these statuses in - offers and skip unavailable offers or those with no quota, enable + By default, dstack uses [Nebius Capacity Advisor](https://docs.nebius.com/compute/virtual-machines/capacity-advisor) - with `capacity_advisor: true`. + to check GPU availability and quota. This shows availability statuses in offers and + lets dstack skip offers that are unavailable or have no quota. - Fetching availability and quota adds roughly 1–3 seconds to getting offers. - Both are cached for 10 minutes. + Set `capacity_advisor: false` in the Nebius backend configuration to disable these checks. + + Advice is cached for 10 minutes. Fetching fresh advice can increase the total offer-response + time when Nebius is the last backend to finish. If advice is missing or the API request + fails, offers remain eligible with unknown availability. ### Crusoe diff --git a/src/dstack/_internal/core/backends/nebius/models.py b/src/dstack/_internal/core/backends/nebius/models.py index c5090bf4e..e5d31b9b1 100644 --- a/src/dstack/_internal/core/backends/nebius/models.py +++ b/src/dstack/_internal/core/backends/nebius/models.py @@ -145,7 +145,7 @@ class NebiusBackendConfig(CoreModel): Field( description="Use Nebius Capacity Advisor to check quota and capacity when collecting offers" ), - ] = False + ] = True tags: Annotated[ Optional[Dict[str, str]], Field( diff --git a/src/tests/_internal/core/backends/nebius/test_compute.py b/src/tests/_internal/core/backends/nebius/test_compute.py index aa5619ecb..06d226310 100644 --- a/src/tests/_internal/core/backends/nebius/test_compute.py +++ b/src/tests/_internal/core/backends/nebius/test_compute.py @@ -62,7 +62,6 @@ def make_compute(resource_advice_cache: Optional[ComputeTTLCache] = None) -> NebiusCompute: return NebiusCompute( NebiusConfig( - capacity_advisor=True, creds=NebiusServiceAccountCreds( service_account_id="service-account-id", public_key_id="public-key-id", @@ -229,14 +228,16 @@ def mock_capacity_advice(self, mocker): compute_module.resources, "list_resource_advice", return_value=[] ) - def test_capacity_advisor_disabled_by_default(self, mocker, mock_capacity_advice): + def test_capacity_advisor_can_be_disabled(self, mocker, mock_capacity_advice): mocker.patch.object( compute_module, "get_catalog_offers", return_value=[make_offer(1, spot=False, is_preemptible_flat_rate=False)], ) compute = make_compute() - compute.config = NebiusConfig(creds=compute.config.creds, fabrics=["fabric-2"]) + compute.config = NebiusConfig( + creds=compute.config.creds, fabrics=["fabric-2"], capacity_advisor=False + ) offers = compute.get_all_offers_with_availability(unallocated_resources=False)