Skip to content

Commit 6fc435b

Browse files
authored
also show spot compute instances in provider selection (#33)
1 parent a1ae3d2 commit 6fc435b

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "prime-cli"
3-
version = "0.2.10"
3+
version = "0.2.11"
44
description = "Prime Intellect CLI"
55
readme = "README.md"
66
requires-python = ">=3.9"

src/prime_cli/commands/pods.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -389,12 +389,13 @@ def select_provider_from_configs(
389389
key=lambda x: x.prices.price if x.prices else float("inf")
390390
)
391391

392-
# Remove duplicates while preserving order
393-
seen_providers = set()
392+
seen_provider_types = set()
394393
unique_configs = []
395394
for gpu in matching_configs:
396-
if gpu.provider not in seen_providers:
397-
seen_providers.add(gpu.provider)
395+
# Create unique key combining provider and spot status
396+
provider_type = (gpu.provider, gpu.is_spot)
397+
if provider_type not in seen_provider_types:
398+
seen_provider_types.add(provider_type)
398399
unique_configs.append(gpu)
399400

400401
if len(unique_configs) > 1:
@@ -406,7 +407,10 @@ def select_provider_from_configs(
406407
if price != float("inf")
407408
else "N/A"
408409
)
409-
console.print(f"{idx}. {gpu.provider} ({price_display})")
410+
spot_display = " (spot)" if gpu.is_spot else ""
411+
console.print(
412+
f"{idx}. {gpu.provider}{spot_display} ({price_display})"
413+
)
410414

411415
provider_idx = typer.prompt(
412416
"Select provider number",

0 commit comments

Comments
 (0)