Skip to content

Add experiment prompts functionality#19156

Merged
TomeHirata merged 6 commits intomlflow:masterfrom
TomeHirata:feat/experiment-scoped-prompt-page
Dec 3, 2025
Merged

Add experiment prompts functionality#19156
TomeHirata merged 6 commits intomlflow:masterfrom
TomeHirata:feat/experiment-scoped-prompt-page

Conversation

@TomeHirata
Copy link
Collaborator

@TomeHirata TomeHirata commented Dec 2, 2025

Related Issues/PRs

n/a

What changes are proposed in this pull request?

Add experiment-scoped prompt pages for better organization of features and consistency with Databricks. Kept existing global prompt tab in order to allow users to view unscoped prompts.

  • Introduced new routes for experiment prompts and prompt details.
  • Updated the Prompts API to support filtering by experiment ID.
  • Enhanced the PromptsPage and PromptsDetailsPage components to handle experiment context.
  • Added tests for experiment-scoped prompts and prompt creation with experiment tags.
  • Updated side navigation to include a Prompts tab.
Screen.Recording.2025-12-02.at.17.13.15.mov

How is this PR tested?

  • Existing unit/integration tests
  • New unit/integration tests
  • Manual tests

Does this PR require documentation update?

  • No. You can skip the rest of this section.
  • Yes. I've updated:
    • Examples
    • API references
    • Instructions

Release Notes

Is this a user-facing change?

  • No. You can skip the rest of this section.
  • Yes. Give a description of this change to be included in the release notes for MLflow users.

What component(s), interfaces, languages, and integrations does this PR affect?

Components

  • area/tracking: Tracking Service, tracking client APIs, autologging
  • area/models: MLmodel format, model serialization/deserialization, flavors
  • area/model-registry: Model Registry service, APIs, and the fluent client calls for Model Registry
  • area/scoring: MLflow Model server, model deployment tools, Spark UDFs
  • area/evaluation: MLflow model evaluation features, evaluation metrics, and evaluation workflows
  • area/gateway: MLflow AI Gateway client APIs, server, and third-party integrations
  • area/prompts: MLflow prompt engineering features, prompt templates, and prompt management
  • area/tracing: MLflow Tracing features, tracing APIs, and LLM tracing functionality
  • area/projects: MLproject format, project running backends
  • area/uiux: Front-end, user experience, plotting, JavaScript, JavaScript dev server
  • area/build: Build and test infrastructure for MLflow
  • area/docs: MLflow documentation pages

How should the PR be classified in the release notes? Choose one:

  • rn/none - No description will be included. The PR will be mentioned only by the PR number in the "Small Bugfixes and Documentation Updates" section
  • rn/breaking-change - The PR will be mentioned in the "Breaking Changes" section
  • rn/feature - A new user-facing feature worth mentioning in the release notes
  • rn/bug-fix - A user-facing bug fix worth mentioning in the release notes
  • rn/documentation - A user-facing documentation change worth mentioning in the release notes

Should this PR be included in the next patch release?

Yes should be selected for bug fixes, documentation updates, and other small changes. No should be selected for new features and larger changes. If you're unsure about the release classification of this PR, leave this unchecked to let the maintainers decide.

What is a minor/patch release?
  • Minor release: a release that increments the second part of the version number (e.g., 1.2.0 -> 1.3.0).
    Bug fixes, doc updates and new features usually go into minor releases.
  • Patch release: a release that increments the third part of the version number (e.g., 1.2.0 -> 1.2.1).
    Bug fixes and doc updates usually go into patch releases.
  • Yes (this PR will be cherry-picked and included in the next patch release)
  • No (this PR will be included in the next minor release)

- Introduced new routes for experiment prompts and prompt details.
- Updated the Prompts API to support filtering by experiment ID.
- Enhanced the PromptsPage and PromptsDetailsPage components to handle experiment context.
- Added tests for experiment-scoped prompts and prompt creation with experiment tags.
- Updated side navigation to include a Prompts tab.

This commit enhances the experiment tracking capabilities by linking prompts to specific experiments, allowing for better organization and retrieval of prompts associated with experiments.

Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
@github-actions github-actions bot added v3.7.0 area/uiux Front-end, user experience, plotting, JavaScript, JavaScript dev server rn/feature Mention under Features in Changelogs. labels Dec 2, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds experiment-scoped prompt pages to improve organization and align with Databricks functionality. Prompts can now be viewed and managed within the context of specific experiments, while maintaining backward compatibility with the global prompts page.

  • Introduced new routes for experiment-scoped prompts (/experiments/:experimentId/prompts and /experiments/:experimentId/prompts/:promptName)
  • Updated the Prompts API to filter prompts by experiment ID using comma-separated tag values
  • Modified PromptsPage and PromptsDetailsPage components to accept an optional experimentId prop

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
mlflow/server/js/src/experiment-tracking/routes.ts Added new PageId entries for experiment prompts list and details, and updated getPromptDetailsPageRoute to support optional experimentId parameter
mlflow/server/js/src/experiment-tracking/route-defs.ts Registered experiment-scoped prompt routes with lazy-loaded components
mlflow/server/js/src/experiment-tracking/pages/prompts/utils.ts Added PROMPT_EXPERIMENT_IDS_TAG_KEY constant and extended PromptsTableMetadata type to include experimentId
mlflow/server/js/src/experiment-tracking/pages/prompts/hooks/usePromptsListQuery.tsx Extended query to accept and pass experimentId parameter for filtering
mlflow/server/js/src/experiment-tracking/pages/prompts/hooks/useCreateRegisteredPromptMutation.tsx Added promptTags parameter to support experiment ID tagging during prompt creation
mlflow/server/js/src/experiment-tracking/pages/prompts/hooks/useCreatePromptModal.tsx Added logic to create experiment ID tags when creating prompts within experiment scope
mlflow/server/js/src/experiment-tracking/pages/prompts/components/PromptsListTableNameCell.tsx Updated to generate experiment-scoped prompt detail links when experimentId is present
mlflow/server/js/src/experiment-tracking/pages/prompts/components/PromptsListTable.tsx Added experimentId prop and passed it to table metadata
mlflow/server/js/src/experiment-tracking/pages/prompts/api.ts Implemented experiment ID filtering using ILIKE query on comma-separated experiment IDs tag, and added additionalTags parameter to createRegisteredPrompt
mlflow/server/js/src/experiment-tracking/pages/prompts/api.test.ts Added comprehensive tests for experiment ID filtering and prompt creation with additional tags
mlflow/server/js/src/experiment-tracking/pages/prompts/PromptsPage.tsx Added experimentId prop and updated navigation to handle experiment-scoped routes
mlflow/server/js/src/experiment-tracking/pages/prompts/PromptsPage.test.tsx Added test suite for experiment-scoped prompts including filtering and tag creation
mlflow/server/js/src/experiment-tracking/pages/prompts/PromptsDetailsPage.tsx Added experimentId prop, updated navigation on delete, and conditionally rendered breadcrumbs
mlflow/server/js/src/experiment-tracking/pages/prompts/ExperimentPromptsPage.tsx New wrapper component that extracts experimentId from route params and passes to PromptsPage
mlflow/server/js/src/experiment-tracking/pages/prompts/ExperimentPromptDetailsPage.tsx New wrapper component that extracts experimentId from route params and passes to PromptsDetailsPage
mlflow/server/js/src/experiment-tracking/pages/experiment-page-tabs/side-nav/constants.tsx Added Prompts tab to the experiment side navigation under the "Prompts & versions" section
mlflow/server/js/src/experiment-tracking/components/experiment-page/hooks/useGetExperimentPageActiveTabByRoute.tsx Mapped experiment prompt routes to the Prompts tab name for active tab detection

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 2, 2025

Documentation preview for 88143e7 is available at:

More info
  • Ignore this comment if this PR does not change the documentation.
  • The preview is updated when a new commit is pushed to this PR.
  • This comment was created by this workflow run.
  • The documentation was built by this workflow run.

Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
Comment on lines +18 to +19
[RoutePaths.experimentPromptsList]: ExperimentPageTabName.Prompts,
[RoutePaths.experimentPrompt]: ExperimentPageTabName.Prompts,
Copy link
Collaborator

Choose a reason for hiding this comment

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

just so i remember to handle this in backsync, can you put some comment like // OSS experiment prompt page routes? this needs to be deconflicted / gated properly upstream

experimentPageTabChatSessions = 'mlflow.experiment.tab.chat-sessions',
experimentPageTabSingleChatSession = 'mlflow.experiment.tab.single-chat-session',
experimentPageTabScorers = 'mlflow.experiment.tab.scorers',
experimentPromptsList = 'mlflow.experiment.prompts.list',
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is called "experimentPageTabPrompts" upstream, can we update the name here to match?

Copy link
Collaborator

@daniellok-db daniellok-db left a comment

Choose a reason for hiding this comment

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

overall lgtm

Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
@TomeHirata TomeHirata enabled auto-merge December 3, 2025 08:23
@TomeHirata TomeHirata added this pull request to the merge queue Dec 3, 2025
Merged via the queue into mlflow:master with commit b6eb02b Dec 3, 2025
50 checks passed
@TomeHirata TomeHirata deleted the feat/experiment-scoped-prompt-page branch December 3, 2025 09:02
BenWilson2 pushed a commit to BenWilson2/mlflow that referenced this pull request Dec 4, 2025
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
BenWilson2 pushed a commit that referenced this pull request Dec 4, 2025
Signed-off-by: Tomu Hirata <tomu.hirata@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/uiux Front-end, user experience, plotting, JavaScript, JavaScript dev server rn/feature Mention under Features in Changelogs. v3.7.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants