Prompt Migration: collaboration issue to for Code Generations

Overview

Within Prompt Migration to AI Gateway (&14259 - closed) prompts are migrated from GitLab Rails to AI Gateway

groupcustom models decided to start with moving Code Suggestions prompts for custom models.

Related MRs:

How to migrate a prompt for Code Generations

  1. feat(agents): execute code generations via agent (gitlab-org/modelops/applied-ml/code-suggestions/ai-assist!1096 - merged) is merged and it means that the prompt definition should be located in ai_gateway/prompts/definitions/<feature-section>/<feature>/<model>.yml, for example, ai_gateway/prompts/definitions/code_suggestions/generations/mistral.yml for Code Generations powered by Mistral model or ai_gateway/prompts/definitions/code_suggestions/generations/base.yml powered by Anthropic model.
  2. In order to test the behavior, enable ai_custom_models_prompts_migration feature flag
  3. Define the prompt in ai_gateway/prompts/definitions/code_suggestions/generations/<model-name>.yml file. Currently, the following fields are supported: prefix (content above cursor), instruction (prompt), language and file_name.
  4. Verify that LLM received the correct prompt anyway.

Other models

  1. Define prompt definition, for example ai_gateway/prompts/definitions/code_suggestions/generations/mixtral.yml.
  2. Enable ai_custom_models_prompts_migration introduced in !161018 (merged)
  3. Verify that LLM received the correct prompt.

Merging the work

  1. Define the prompt in AI Gateway
  2. Enable ai_custom_models_prompts_migration and verify it works
Feature.enable(:ai_custom_models_prompts_migration)
  1. Perform the evaluations according to the steps defined in the issues like: Migrate Code Generation Prompts: Mistral-7B-v0.1 (#470819 - closed)
  2. Merge the AI Gateway MR
Edited by Julie Huang