Skip to content

Improve BYOM registration metadata defaults and ownership - #1107

Draft
Selena Yang (selenayang888) wants to merge 3 commits into
mainfrom
syang/byom-metadata-defaults
Draft

Selena Yang (selenayang888) wants to merge 3 commits into
mainfrom
syang/byom-metadata-defaults

Conversation

@selenayang888

@selenayang888 Selena Yang (selenayang888) commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Improve BYOM registration metadata handling by applying explicit ownership rules:

  • Require application-owned metadata such as task.
  • Derive good defaults where authoritative information is available.
  • Preserve supported application overrides.
  • Prevent applications from overriding SDK-owned metadata.

Metadata ownership reference:
BYOM Metadata Ownership

Changes

  • Derive context_length from genai_config.json.
  • Default display_name to the model name and publisher to local.
  • Derive execution provider and device type when provider configuration is recognized.
  • Default input and output modalities from the required task.
  • Preserve application-supplied values for overridable metadata.
  • Ignore conflicting caller values for SDK-owned identity, type, timestamp, path, and internal metadata, and populate those fields from authoritative SDK sources.
  • Fix canonical WebGPU and Ryzen AI provider-name round trips.
  • Persist the fully resolved metadata in the local model registration index.

@vercel

vercel Bot commented Sep 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
foundry-local Ready Ready Preview Sep 16, 2026 12:18am UTC

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Some supported metadata remains unresolved, authoritative prompt templates are discarded, and public API documentation is outdated.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Improves BYOM registration by resolving SDK-owned metadata from authoritative sources and preserving supported overrides.

Changes:

  • Derives defaults for identity, runtime, modalities, and context length.
  • Normalizes execution-provider registration names.
  • Expands registration and persistence tests.
File summaries
File Description
local_model_catalog.cc Resolves and persists BYOM metadata.
local_model_catalog.h Extends metadata resolution with GenAI configuration.
execution_provider.h Adds canonical WebGPU and Ryzen AI names.
local_model_catalog_test.cc Tests defaults, ownership, and persistence.
execution_provider_test.cc Tests provider-name round trips.
c_api_test.cc Verifies resolved metadata through the C API.
Review details

Suppressed comments (1)

sdk_v2/cpp/src/catalog/local_model_catalog.cc:403

  • Clearing caller templates is appropriate for SDK-owned metadata, but no authoritative replacement is applied even though the parsed genai_config.model->prompt_templates is available. Consequently, a model that declares templates in genai_config.json exposes and persists an empty prompt-template set rather than fully resolved metadata. Copy those parsed templates after discarding the caller values and add a round-trip assertion.
  resolved.prompt_templates = {};
  • Files reviewed: 6/6 changed files
  • Comments generated: 4
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread sdk_v2/cpp/src/catalog/local_model_catalog.cc
Comment thread sdk_v2/cpp/src/catalog/local_model_catalog.cc
Comment thread sdk_v2/cpp/src/catalog/local_model_catalog.cc
Comment thread sdk_v2/cpp/test/internal_api/local_model_catalog_test.cc Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants