Skip to content
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

chore(detach): update arg description & error messaging #42

Merged
merged 13 commits into from
Dec 6, 2024

Conversation

zwhitfield3
Copy link
Contributor

@zwhitfield3 zwhitfield3 commented Dec 3, 2024

Description

Work Item

This PR updates the model resource argument description to only specify an alias. In addition, this PR also updates the error messaging when an invalid alias is entered. This PR also fixes a regression from a previous refactor that used the incorrect model ID.

Testing

NOTE: Until the addon service name is updated to heroku-inference instead of inference, make sure you export the correct environment variable via export HEROKU_INFERENCE_ADDON="inference-dev"

  1. Pull down branch & yarn && yarn build it up
  2. Create a test app to detach the model attachment from via heroku apps:create test-cli-ai-plugin-app
  3. Create a test model resource in preparation for creating a model attachment via heroku ai:models:create claude-3-5-haiku --as MY_EXAMPLE_MODEL --app test-cli-ai-plugin-app
  4. Get the name of the addon name via heroku addons -a test-cli-ai-plugin-app. The name will be in parenthesis with the following format inference-dev-<adjective>-XXXXX
  5. Create a model attachment via heroku addons:attach <inference-dev-<adjective>-XXXXX> -a test-cli-ai-plugin-app --as my_example_model_again
  6. Confirm that using the addon name when detaching the model attachment errors and mentions needing a valid alias via ./bin/run ai:models:detach <inference-dev-<adjective>-XXXXX> -a test-cli-ai-plugin-app
  7. Confirm that model attachment successfully detaches by using it's attachment alias via ./bin/run ai:models:detach my_example_model_again -a test-cli-ai-plugin-app

Test clean up

  1. Destroy the model resource via heroku ai:models:destroy MY_EXAMPLE_MODEL -a test-cli-ai-plugin-app
  2. Destroy the test app via heroku apps:destroy -a test-cli-ai-plugin-app

Also updated the order of precedence for the environment variable in the addonServiceSlug getter because we don't update the addonServiceSlug value before evaluating it's value. This is problematic for managing different environments like heroku-inference vs. inference-dev for the HEROKU_INFERENCE_ADDON environment variable.
@zwhitfield3 zwhitfield3 force-pushed the zw/detach-update-error-messaging branch from 5ab5c07 to 54c0d8d Compare December 5, 2024 07:44
@zwhitfield3 zwhitfield3 force-pushed the zw/detach-update-error-messaging branch from 54c0d8d to fb3e8af Compare December 5, 2024 07:46
@zwhitfield3 zwhitfield3 marked this pull request as ready for review December 5, 2024 22:48
@zwhitfield3 zwhitfield3 requested a review from a team as a code owner December 5, 2024 22:48
Copy link

@leoncalermo leoncalermo left a comment

Choose a reason for hiding this comment

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

LGTM!!

@zwhitfield3 zwhitfield3 merged commit 1dcf527 into main Dec 6, 2024
6 checks passed
@zwhitfield3 zwhitfield3 deleted the zw/detach-update-error-messaging branch December 6, 2024 00:25
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.

3 participants