-
Notifications
You must be signed in to change notification settings - Fork 15
Feature: credits buy commands #397
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
Draft
1yam
wants to merge
19
commits into
master
Choose a base branch
from
1yam-credits-buy
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ce number of number call
7ca29a2 to
cac3e45
Compare
3ef8b7b to
5f93d05
Compare
Base automatically changed from
1yam-credits-handling
to
1yam-pricing-refactor
September 30, 2025 14:46
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR add a new commands:
aleph credits buy that redirect to payment gateway
Related ClickUp, GitHub or Jira tickets : ALEPH-621
Self proofreading checklist
Changes
This pull request introduces major improvements to the Aleph CLI, focusing on supporting a new credits-based payment system for instances, enhancing GPU and CRN selection logic, and refactoring pricing and payment flows. The changes also add a new
creditscommand group and update dependencies to support these features.Credits System Integration & CLI Enhancements
Added a new
creditscommand group (src/aleph_client/commands/credit.py) to the CLI, allowing users to view, list, and buy Aleph credits directly from the command line. This includes commands to display credit balances, list credit holders, and provide purchase instructions. [1] [2] [3]Updated the
account balancecommand to display the user's credits alongside other balances, fetching this information via the new credits API. Includes error handling for nodes that do not support credits yet. [1] [2]Instance Creation Flow & Payment Refactor
Refactored the instance creation logic to support credits as a payment method. This includes checking for sufficient credit balance, integrating credit price calculations, and handling credit-specific errors. The payment logic now distinguishes between hold, superfluid, and credit payments, with appropriate checks for each.
Improved pricing and tier selection: switched to using
fetch_pricing_aggregateand refactored how tiers/specs are selected and validated, including better handling for GPU and confidential instances. The code now ensures the correct specs are used based on the chosen tier and payment type.CRN & GPU Selection Refactor
call_program_crn_list,filter_crn,find_gpu_on_network). Improved user prompts and validation for selecting CRNs and GPUs, and enhanced the display of CRN specs. [1] [2] [3] [4]Dependency Updates
pyproject.tomlto support the credits system, including pinningaleph-messageto a newer version and using a specific branch ofaleph-sdk-pythonwith credits support.Miscellaneous Refactoring
Encoded references:
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16]
How to test
aleph credits buy
Print screen / video
Notes
There isn't a Payment gateway url yet so i'm using a fake one