Skip to content

Add Self-hosted Models Create Page in Vue

What does this MR do and why?

This MR re-implements the Create page for self-hosted models, accessible from the Admin dashboard. The goal is to re-write the existing HAML page and convert it to VueJS, following the new designs in Figma. The feature is behind a FF custom_models_vue_app.

What this MR does:

  • Mounts the NewSelfHostedModel Vue app when the admin/ai/self_hosted_models/new endpoint is visited
  • Adds reusable self hosted model form component (can also be used for building the Edit page)
  • Invokes createSelfHostedModel mutation for data
  • Handles required field validations
  • Handles server validations

Out of scope:

  • A success GLAlert as seen below will be added in a new piece of work (this MR is very big already) Screenshot_2024-07-19_at_12.15.42_PM

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
Screen_Recording_2024-07-19_at_2.59.30_PM Screen_Recording_2024-07-19_at_2.50.41_PM

How to set up and validate locally

You will need:

  • An active GitLab ultimate license
  • Disable SAAS mode when running GDK
    • echo $GITLAB_SIMULATE_SAAS should return 0
    • See the docs for more information
  • Run the following commands in your terminal
add_on = GitlabSubscriptions::AddOn.find_or_create_by!(name: "code_suggestions") {|e| e.description = "Test"}
add_on_purchase = GitlabSubscriptions::AddOnPurchase.create!(add_on: add_on, expires_on: 1.month.from_now, quantity: 5, purchase_xid: 'A-S0001')
Feature.enable(:self_managed_code_suggestions)
Feature.enable(:ai_custom_model)
Feature.enable(:custom_models_vue_app)
ApplicationSetting.first.update(duo_features_enabled: true)
  1. Navigate to your GDK instance in browser
  2. Click on "Admin" button at the bottom of the left sidebar
  3. Open the "AI-powered features" drop down in the admin area sidebar
  4. Click on "Self-hosted models"
  5. You may may be asked to accept some terms and conditions with usage (accept them)
  6. If you do not have any models created, you will see an empty state where you will be prompted to create a new one. If you already have models, you will see a table and a button labeled "New model". Both will lead to the same "Create" page which is what this MR has rebuilt.

Numbered steps to set up and validate the change are strongly suggested.

Related to #463135 (closed)

Edited by Julie Huang

Merge request reports