Skip to content

[Vercel #1] Prep for adding more integrations#18400

Merged
B-Step62 merged 3 commits intomlflow:masterfrom
B-Step62:stack/vercelai-1
Oct 24, 2025
Merged

[Vercel #1] Prep for adding more integrations#18400
B-Step62 merged 3 commits intomlflow:masterfrom
B-Step62:stack/vercelai-1

Conversation

@B-Step62
Copy link
Collaborator

@B-Step62 B-Step62 commented Oct 20, 2025

🥞 Stacked PR

Use this link to review incremental changes.


What changes are proposed in this pull request?

This is the prep PR for adding Vercel AI integration. Mostly minor tweaks to the core tracing logic to make it flexible enough to support vercel AI.

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)

Signed-off-by: B-Step62 <yuki.watanabe@databricks.com>
@github-actions github-actions bot added area/tracing MLflow Tracing and its integrations rn/none List under Small Changes in Changelogs. labels Oct 20, 2025
@B-Step62 B-Step62 changed the title Prep for adding more integrations [Vercel #1] Prep for adding more integrations Oct 20, 2025
"@types/node": "^20.4.5",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"openai": "^4.0.0",
Copy link
Collaborator

@TomeHirata TomeHirata Oct 23, 2025

Choose a reason for hiding this comment

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

Why did we have openai in the core package dep previously?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't recall a particular reason, but most likely me didn't understand the Typescript packaging system well

Copy link
Collaborator

@TomeHirata TomeHirata left a comment

Choose a reason for hiding this comment

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

LGTM

@TomeHirata TomeHirata requested a review from Copilot October 23, 2025 07:48
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 prepares the codebase for adding Vercel AI integration by refactoring core tracing logic to be more flexible and introducing shared test utilities. The changes focus on improving span lifecycle management, adding message format tracking, and consolidating test infrastructure.

Key changes:

  • Introduced MESSAGE_FORMAT attribute to distinguish between different LLM integration formats (e.g., OpenAI, Vercel AI)
  • Refactored span registration to occur in MlflowSpanProcessor instead of at span creation time
  • Created shared OpenAI test helper utilities to reduce code duplication across integrations

Reviewed Changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
libs/typescript/integrations/openai/src/index.ts Added MESSAGE_FORMAT attribute to OpenAI spans
libs/typescript/integrations/openai/tests/index.test.ts Migrated to shared OpenAI test helper utilities
libs/typescript/integrations/openai/package.json Updated peer dependencies to more flexible version constraints
libs/typescript/integrations/helpers/openaiTestHelper.ts Created shared MSW server setup and test utilities for OpenAI mocking
libs/typescript/core/src/exporters/mlflow.ts Moved span registration to processor and added auto-OK status handling
libs/typescript/core/src/core/trace_manager.ts Made getSpan parameters nullable for safer usage
libs/typescript/core/src/core/entities/span.ts Added mutation capability for ended spans and refactored attribute setting
libs/typescript/core/src/core/constants.ts Added MESSAGE_FORMAT constant for tracking integration formats
libs/typescript/core/src/core/api.ts Refactored span creation to defer registration to processor
libs/typescript/core/package.json Removed unused OpenAI dependency from core package
Files not reviewed (1)
  • libs/typescript/package-lock.json: Language not supported

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Signed-off-by: B-Step62 <yuki.watanabe@databricks.com>
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.

lgtm

@B-Step62 B-Step62 added this pull request to the merge queue Oct 24, 2025
Merged via the queue into mlflow:master with commit a85b2f3 Oct 24, 2025
43 checks passed
@B-Step62 B-Step62 deleted the stack/vercelai-1 branch October 24, 2025 06:33
jimilp7 pushed a commit to backspace-org/mlflow that referenced this pull request Nov 21, 2025
Signed-off-by: B-Step62 <yuki.watanabe@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/tracing MLflow Tracing and its integrations rn/none List under Small Changes in Changelogs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants