Skip to content

Comments

[EAGLE-7196]: Various improvement in CLI/SDK for model upload, logs, etc.#939

Open
zeiler wants to merge 16 commits intomasterfrom
zeiler-hackday-feb10
Open

[EAGLE-7196]: Various improvement in CLI/SDK for model upload, logs, etc.#939
zeiler wants to merge 16 commits intomasterfrom
zeiler-hackday-feb10

Conversation

@zeiler
Copy link
Member

@zeiler zeiler commented Feb 11, 2026

This pull request introduces several improvements to the Clarifai CLI, focusing on better automation support, enhanced user experience, and expanded functionality for deployment and context management. The most significant changes are grouped below:

Automation and non-interactive mode improvements:

  • Replaced manual input prompts with the prompt_yes_no utility throughout artifact.py and model.py for improved automation and scriptability, including default behaviors for yes/no questions. [1] [2] [3] [4] [5] [6] [7]
  • Added checks for non-interactive mode (sys.stdin.isatty()) in context and login commands, enforcing required arguments and aborting gracefully when user input isn't possible. [1] [2] [3]

Deployment functionality enhancements:

  • Refactored the deployment creation and listing commands to use YAML config files, support more flexible arguments, and allow filtering by nodepool_id and compute_cluster_id. Also updated help text and examples for clarity. [1] [2]
  • Improved the Deployment client class by filtering kwargs to match proto fields and adding a refresh method to sync deployment info from the API. [1] [2] [3]

Context and credential management improvements:

  • Enhanced context creation and login flows to support custom context names, display helpful information, and allow multiple contexts for easier account/project switching.
  • Added support for displaying HuggingFace tokens (HF_TOKEN) in context listings and expanded command aliases. [1] [2]

Model upload and initialization changes:

  • Added an --autodeploy flag to the model upload command for automatic deployment after upload, and removed unnecessary manual prompts during initialization. [1] [2] [3] [4]

These changes collectively make the CLI more robust for both interactive and automated workflows, improve clarity for users, and expand deployment and context management capabilities.

@zeiler zeiler requested a review from luv-bansal February 11, 2026 04:51
Copy link
Contributor

@luv-bansal luv-bansal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deployment logs feature not seems to work, and few comments. apart of it looks good

@click.pass_context
def create(ctx, nodepool_id, deployment_id, config):
"""Create a new Deployment with the given config file."""
def create(ctx, config):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see wait=True parameter to nodepool.create_deployment(), we can also have --wait flag in CLI as well

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, I think default value is True, so it's fine, but still good to have a flag

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah feel free to run with this PR and add any improvements.

self.logger.info(
f"Waiting for deployment '{deployment_id}' to reach {min_replicas} running replicas..."
)
self.logger.info("Streaming logs (runner and runner.events):\n")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove (runner and runner.events) in this log, user don't care about it and probably won't understand

]
return f"Deployment Details: \n{', '.join(attribute_strings)}\n"

def logs(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I test uploading a cpu model with --autodeploy flag and my pod is scheduled but logs just stuck at below, something is wrong

⏳ Deploying model...
[INFO] 17:27:04.530160 Deployment with ID 'deploy-browser-mcp-server-110286' is created:
code: SUCCESS
description: "Ok"
req_id: "sdk-python-12.1.7-bbd76943e5b54ca2af7124eb2f11bfab"
 |  thread=8588059200 
[INFO] 17:27:04.534269 Waiting for deployment 'deploy-browser-mcp-server-110286' to reach 1 running replicas... |  thread=8588059200 
[INFO] 17:27:04.534343 Streaming logs (runner and runner.events):
 |  thread=8588059200 

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah this is my experience as well. I'll post about it in CO channel the reason why

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants