Skip to content

add ability to filter by provider #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 24, 2025
Merged
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
10 changes: 10 additions & 0 deletions src/prime_cli/commands/availability.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ def list(
socket: Optional[str] = typer.Option(
None, help="Filter by socket type (e.g., PCIe, SXM5, SXM4)"
),
provider: Optional[str] = typer.Option(
None, help="Filter by provider (e.g., aws, azure, google)"
),
group_similar: bool = typer.Option(
True, help="Group similar configurations from same provider"
),
Expand All @@ -72,6 +75,13 @@ def list(
gpu_type=gpu_type, gpu_count=gpu_count, regions=regions
)

# Filter by provider if provided
if provider:
availability_data = {
gpu_type: [gpu for gpu in gpus if gpu.provider == provider]
for gpu_type, gpus in availability_data.items()
}

# Create display table
table = Table(title="Available GPU Resources")
table.add_column("ID", style="cyan", no_wrap=True)
Expand Down