Skip to content

Bring Your Own Model Language Bindings for C#, JavaScript, Python, and Rust SDKs - #1062

Open
Selena Yang (selenayang888) wants to merge 5 commits into
mainfrom
syang/byom-language-bindings
Open

Bring Your Own Model Language Bindings for C#, JavaScript, Python, and Rust SDKs#1062
Selena Yang (selenayang888) wants to merge 5 commits into
mainfrom
syang/byom-language-bindings

Conversation

@selenayang888

Copy link
Copy Markdown
Contributor

Extends the Bring Your Own Model (BYOM) API introduced in BYOM to the C#, JavaScript/TypeScript, Python, and Rust SDK v2 bindings.

Applications can select the local catalog, register an existing local ONNX model directory, use the returned model through the standard inference APIs, and unregister it without deleting or taking ownership of the model assets.

@vercel

vercel Bot commented Sep 2, 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 3, 2026 10:23pm 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

Borrowed Python metadata can outlive its native manager, C# metadata copying races caller mutation, and public API compatibility and Rust coverage need correction.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Extends SDK v2 BYOM support across C#, JavaScript/TypeScript, Python, and Rust.

Changes:

  • Adds local catalog selection and model registration APIs.
  • Adds mutable metadata builders and ABI v2 bindings.
  • Adds BYOM documentation and integration/API tests.
File summaries
File Description
sdk_v2/rust/tests/public_api.rs Checks public BYOM API types.
sdk_v2/rust/src/types.rs Adds catalog types and metadata builder.
sdk_v2/rust/src/lib.rs Exports new Rust types.
sdk_v2/rust/src/foundry_local_manager.rs Adds typed catalog access.
sdk_v2/rust/src/detail/native.rs Implements native registration calls.
sdk_v2/rust/src/detail/manager.rs Retrieves catalogs by type.
sdk_v2/rust/src/detail/ffi.rs Adds ABI v2 definitions.
sdk_v2/rust/src/catalog.rs Exposes BYOM operations.
sdk_v2/rust/README.md Documents Rust BYOM usage.
sdk_v2/python/test/unit/test_imports.py Verifies catalog type export.
sdk_v2/python/test/unit/test_catalog_types.py Tests catalog enum defaults.
sdk_v2/python/test/integration/test_byom.py Exercises Python BYOM behavior.
sdk_v2/python/src/foundry_local_sdk/model_info.py Adds native mutable and borrowed metadata.
sdk_v2/python/src/foundry_local_sdk/imodel.py Returns borrowed metadata views.
sdk_v2/python/src/foundry_local_sdk/foundry_local_manager.py Adds typed catalog caching.
sdk_v2/python/src/foundry_local_sdk/catalog.py Adds registration operations.
sdk_v2/python/src/foundry_local_sdk/__init__.py Exports CatalogType.
sdk_v2/python/README.md Documents Python BYOM usage.
sdk_v2/js/test/catalog.test.ts Updates native catalog mocks.
sdk_v2/js/test/byom.test.ts Tests JavaScript BYOM APIs.
sdk_v2/js/src/types.ts Adds CatalogType.
sdk_v2/js/src/modelInfo.ts Adds mutable metadata wrapper.
sdk_v2/js/src/index.ts Exports BYOM types and constructors.
sdk_v2/js/src/foundryLocalManager.ts Adds typed catalog caching.
sdk_v2/js/src/detail/native.ts Extends native interfaces.
sdk_v2/js/src/catalog.ts Adds sync and async BYOM methods.
sdk_v2/js/README.md Documents JavaScript BYOM usage.
sdk_v2/js/native/src/session.h Retains manager lifetimes.
sdk_v2/js/native/src/session.cc Propagates manager ownership.
sdk_v2/js/native/src/model.h Adds native manager keepalive.
sdk_v2/js/native/src/model.cc Propagates model keepalives.
sdk_v2/js/native/src/model_info.h Declares native metadata wrapper.
sdk_v2/js/native/src/model_info.cc Implements metadata mutation and snapshots.
sdk_v2/js/native/src/manager.h Uses shared manager ownership.
sdk_v2/js/native/src/manager.cc Adds typed catalog retrieval.
sdk_v2/js/native/src/catalog.h Declares native BYOM methods.
sdk_v2/js/native/src/catalog.cc Implements native BYOM dispatch.
sdk_v2/js/native/src/addon.cc Registers metadata constructor.
sdk_v2/js/native/src/addon_data.h Stores metadata constructor reference.
sdk_v2/js/docs/PortJsToSdkV2.md Marks BYOM implemented.
sdk_v2/js/binding.gyp Builds metadata source.
sdk_v2/cs/test/FoundryLocal.Tests/CatalogTests.cs Tests C# BYOM lifecycle.
sdk_v2/cs/src/ICatalog.cs Adds registration contracts.
sdk_v2/cs/src/FoundryModelInfo.cs Adds mutable metadata properties.
sdk_v2/cs/src/FoundryLocalManager.cs Adds typed catalog access.
sdk_v2/cs/src/Enums.cs Adds CatalogType.
sdk_v2/cs/src/Detail/NativeMethods.cs Adds ABI v2 interop declarations.
sdk_v2/cs/src/Detail/FoundryLocalApi.cs Implements native BYOM wrappers.
sdk_v2/cs/src/Catalog.cs Implements C# registration operations.
sdk_v2/cs/README.md Documents C# BYOM usage.
Review details
  • Files reviewed: 50/50 changed files
  • Comments generated: 5
  • 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/python/src/foundry_local_sdk/model_info.py Outdated
Comment thread sdk_v2/cs/src/Catalog.cs
Comment thread sdk_v2/js/src/index.ts Outdated
Comment thread sdk_v2/python/src/foundry_local_sdk/model_info.py Outdated
Comment thread sdk_v2/rust/tests/public_api.rs 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