Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions mkdocs/docs/concepts/backends.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/dstack/_internal/core/backends/nebius/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
7 changes: 4 additions & 3 deletions src/tests/_internal/core/backends/nebius/test_compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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)

Expand Down
Loading