Skip to content

Propagate IModel API changes across Python, JS, Rust SDKs and update C# docs#565

Draft
Copilot wants to merge 6 commits intomainfrom
copilot/update-language-bindings-documentation
Draft

Propagate IModel API changes across Python, JS, Rust SDKs and update C# docs#565
Copilot wants to merge 6 commits intomainfrom
copilot/update-language-bindings-documentation

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 30, 2026

Mirrors the C# changes from #556 across all language bindings: public APIs use the IModel interface instead of concrete Model/ModelVariant types, GetLatestVersion moves from Model to Catalog, and ModelVariant becomes an implementation detail.

IModel interface extended (Python, JS)

  • Added info, variants, selected_variant/selectedVariant, select_variant/selectVariant to the abstract interface
  • ModelVariant implements these as self-referential (variants=[self], selected_variant=self, select_variant throws)
# Python - IModel now exposes variant info
model = catalog.get_model("qwen2.5-0.5b")
for v in model.variants:          # List[IModel], not List[ModelVariant]
    print(v.info.name, v.id)
model.select_variant(v)           # takes IModel, not ModelVariant

latest = catalog.get_latest_version(model)  # moved from Model to Catalog

Catalog return types changed (Python, JS)

  • list_models()List[IModel] (was List[Model])
  • get_model()Optional[IModel] (was Optional[Model])
  • get_model_variant()Optional[IModel] (was Optional[ModelVariant])
  • get_cached_models() / get_loaded_models()List[IModel] (was List[ModelVariant])

get_latest_version added to Catalog (Python, JS, Rust)

Moved from Model to Catalog since ModelVariant lacks sufficient context to implement it. Takes any IModel and resolves the latest version by name matching against the variant list.

Rust SDK

  • Added Model::info() (delegates to selected variant)
  • Added Catalog::get_latest_version(&self, model: &Arc<Model>) -> Result<Arc<ModelVariant>>

C# docs and samples updated

  • README, API docs (ICatalog, IModel, Model, ModelVariant) updated to reflect IModel return types
  • ModelVariant docs marked as internal
  • Samples updated to avoid direct ModelVariant type references
  • GetLatestVersionAsync added to ICatalog docs

Copilot AI and others added 6 commits March 30, 2026 16:52
…to Catalog, use IModel return types

Agent-Logs-Url: https://github.com/microsoft/Foundry-Local/sessions/8082508c-1338-48b2-bdd3-6c2c8e35e195

Co-authored-by: baijumeswani <12852605+baijumeswani@users.noreply.github.com>
…log, use IModel return types

Agent-Logs-Url: https://github.com/microsoft/Foundry-Local/sessions/8082508c-1338-48b2-bdd3-6c2c8e35e195

Co-authored-by: baijumeswani <12852605+baijumeswani@users.noreply.github.com>
…, Model uses IModel variants

Agent-Logs-Url: https://github.com/microsoft/Foundry-Local/sessions/8082508c-1338-48b2-bdd3-6c2c8e35e195

Co-authored-by: baijumeswani <12852605+baijumeswani@users.noreply.github.com>
…iants in Catalog

Agent-Logs-Url: https://github.com/microsoft/Foundry-Local/sessions/8082508c-1338-48b2-bdd3-6c2c8e35e195

Co-authored-by: baijumeswani <12852605+baijumeswani@users.noreply.github.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 30, 2026

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

Project Deployment Actions Updated (UTC)
foundry-local Ready Ready Preview, Comment Mar 30, 2026 11:05pm

Request Review

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