Skip to content

[Vercel #4] Add doc + chat UI support for Vercel AI SDK integration#18590

Merged
B-Step62 merged 15 commits intomlflow:masterfrom
B-Step62:stack/vercelai-4
Nov 4, 2025
Merged

[Vercel #4] Add doc + chat UI support for Vercel AI SDK integration#18590
B-Step62 merged 15 commits intomlflow:masterfrom
B-Step62:stack/vercelai-4

Conversation

@B-Step62
Copy link
Collaborator

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

🥞 Stacked PR

Use this link to review incremental changes.

What changes are proposed in this pull request?

Support rich chat rendering for Vercel AI SDK integration and add docs.

How is this PR tested?

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

See video in the doc

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>
Signed-off-by: B-Step62 <yuki.watanabe@databricks.com>
Signed-off-by: B-Step62 <yuki.watanabe@databricks.com>
Signed-off-by: B-Step62 <yuki.watanabe@databricks.com>
Signed-off-by: B-Step62 <yuki.watanabe@databricks.com>
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 30, 2025
@github-actions
Copy link
Contributor

@B-Step62 Thank you for the contribution! Could you fix the following issue(s)?

⚠ DCO check

The DCO check failed. Please sign off your commit(s) by following the instructions here. See https://github.com/mlflow/mlflow/blob/master/CONTRIBUTING.md#sign-your-work for more details.

@B-Step62 B-Step62 force-pushed the stack/vercelai-4 branch 2 times, most recently from 8215812 to e8beb2d Compare October 30, 2025 12:25
Signed-off-by: B-Step62 <yuki.watanabe@databricks.com>
@B-Step62 B-Step62 changed the title Stack/vercelai 4 Add doc + chat UI support for Vercel AI SDK integration Oct 30, 2025
@B-Step62 B-Step62 changed the title Add doc + chat UI support for Vercel AI SDK integration [Vercel #4] Add doc + chat UI support for Vercel AI SDK integration Oct 31, 2025
Signed-off-by: B-Step62 <yuki.watanabe@databricks.com>
@github-actions
Copy link
Contributor

github-actions bot commented Oct 31, 2025

Documentation preview for 39c2851 is available at:

Changed Pages (1)
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: B-Step62 <yuki.watanabe@databricks.com>
if (typedObj.type === 'text' && has(obj, 'text') && isString(typedObj.text)) {
return true;
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

The check typedObj.image instanceof URL could be problematic in environments where URL objects are serialized/deserialized (e.g., across worker boundaries or from JSON).

Consider using a more robust check like:

if (typedObj.type === 'image' && has(obj, 'image')) {
  return isString(typedObj.image) || 
         (isObject(typedObj.image) && typeof typedObj.image.toString === 'function');
}

Or simply check if it's a string or has a valid URL-like structure.

Reviewed by Claude Code on behalf of daniellok-db

Copy link
Collaborator

Choose a reason for hiding this comment

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

would it ever be URL actually? since the data comes from JSON it seems like it should always be a string

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good question, yea it shouldn't be for our case, the code just mirrors vercel spec without thinking.

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 Review Summary

This PR adds comprehensive support for Vercel AI SDK integration with MLflow tracing. The implementation is well-structured and follows existing patterns in the codebase.

Highlights ✨

  1. Comprehensive format support: Handles multiple input/output formats from Vercel AI SDK (messages, prompt, text, response.text, etc.)
  2. Strong type safety: Good use of TypeScript type guards and discriminated unions
  3. Excellent test coverage: Tests cover various scenarios including edge cases
  4. Clean refactoring: The Card component refactoring improves code maintainability
  5. Good documentation: Clear examples and usage instructions for users

Areas for Improvement 🔧

I've left inline comments on specific areas that could be enhanced:

  1. Type safety in URL checking: The instanceof URL check could be more robust for serialized objects
  2. JSDoc documentation: Adding JSDoc to exported functions would improve maintainability
  3. Test coverage: Consider adding tests for malformed input data
  4. Documentation clarity: Adding guidance on how to get/create experiment IDs would help new users

Recommendation

The code is production-ready and well-implemented. The suggestions above are minor improvements that can be addressed if desired, but they don't block merging.

Great work on this integration! 🎉


Reviewed by Claude Code on behalf of daniellok-db

</Link>
) : (
export const SmallLogoCard = ({ children, link }) => {
const Wrapper = link ? Link : 'div';
Copy link
Collaborator

@daniellok-db daniellok-db Nov 4, 2025

Choose a reason for hiding this comment

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

does this work? i'm surprised that a string can be called as JSX component. have we checked any callsites where we don't provide the link prop?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Actually I don't see usage of this card without link, lemme remove the branch.

return { type: 'text', text: item.text };
}
case 'image': {
const imageUrl = item.image instanceof URL ? item.image.toString() : item.image;
Copy link
Collaborator

Choose a reason for hiding this comment

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

same comment here, just curious if it can actually be a URL object. if not then let's remove the conditional and simplify the logic

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 but let's check about these two:

B-Step62 and others added 3 commits November 4, 2025 13:29
Signed-off-by: B-Step62 <yuki.watanabe@databricks.com>
Signed-off-by: Yuki Watanabe <31463517+B-Step62@users.noreply.github.com>
Signed-off-by: B-Step62 <yuki.watanabe@databricks.com>
@B-Step62 B-Step62 merged commit 13a55ab into mlflow:master Nov 4, 2025
46 of 50 checks passed
@B-Step62 B-Step62 added v3.6.0 and removed 3.6.0 labels Nov 5, 2025
B-Step62 added a commit to B-Step62/mlflow that referenced this pull request Nov 7, 2025
…lflow#18590)

Signed-off-by: B-Step62 <yuki.watanabe@databricks.com>
Signed-off-by: Yuki Watanabe <31463517+B-Step62@users.noreply.github.com>
@github-actions github-actions bot added v3.6.1 and removed v3.6.0 labels Nov 8, 2025
B-Step62 added a commit to B-Step62/mlflow that referenced this pull request Nov 11, 2025
…lflow#18590)

Signed-off-by: B-Step62 <yuki.watanabe@databricks.com>
Signed-off-by: Yuki Watanabe <31463517+B-Step62@users.noreply.github.com>
B-Step62 added a commit that referenced this pull request Nov 11, 2025
…18590)

Signed-off-by: B-Step62 <yuki.watanabe@databricks.com>
Signed-off-by: Yuki Watanabe <31463517+B-Step62@users.noreply.github.com>
@B-Step62 B-Step62 added v3.6.0 and removed v3.6.1 labels Nov 11, 2025
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. v3.6.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants