[PR-928]: Added USER_ID to config of CLI Model Init#808
Merged
srikanthbachala20 merged 4 commits intomasterfrom Oct 17, 2025
Merged
[PR-928]: Added USER_ID to config of CLI Model Init#808srikanthbachala20 merged 4 commits intomasterfrom
srikanthbachala20 merged 4 commits intomasterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
Adds propagation of authenticated user_id into model initialization workflows so generated config.yaml files are user-specific and customization helpers update user ownership metadata.
- Added user_id parameter to get_config_template and injected into generated config.yaml.
- Updated CLI init command to extract user_id from context and pass it to model customization functions whose signatures were expanded.
- All model customization helpers now write user_id into existing config.yaml files.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| clarifai/utils/cli.py | Added user_id handling in model customization functions (ollama, huggingface, lmstudio) and updated their signatures to inject user_id into config. |
| clarifai/cli/templates/model_templates.py | Modified get_config_template to include user_id in generated config. |
| clarifai/cli/model.py | Passed user_id from click context to template generation and customization functions; updated calls to new signatures. |
Minimum allowed line rate is |
ackizilkale
approved these changes
Oct 15, 2025
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
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 pull request updates the model initialization workflow to ensure that the
user_idis consistently included in the model configuration files and passed to model customization functions. This improves traceability and aligns configuration files with the authenticated user context. The main changes are focused on propagating theuser_idthroughout the CLI and template generation processes.User context propagation and configuration updates:
user_idis now extracted from the CLI context and passed to all model customization functions (customize_ollama_model,customize_lmstudio_model, andcustomize_huggingface_model), ensuring that the generatedconfig.yamlfiles always include the correct user identifier. [1] [2] [3] [4]get_config_templatefunction now accepts auser_idparameter and inserts it into the generatedconfig.yamltemplate, replacing the placeholder.user_idinto theconfig.yamlfile if it exists, ensuring that any further configuration changes also retain the correct user association. [1] [2] [3]CLI and function signature improvements:
initcommand in the CLI now uses@click.pass_contextto access the current user context, and all relevant function signatures have been updated to accept and use theuser_id. [1] [2] [3] [4]get_config_templatefunction is now called with bothuser_idandmodel_type_id, ensuring the generated configuration is user-specific from the start.These changes make the CLI more robust and ensure that all model configurations are properly associated with the authenticated user.