Skip to content

Add vision (image understanding) web server samples for C#, JS, Rust#821

Merged
samuel100 merged 1 commit into
mainfrom
natke/vision-samples-cs-js-rust
Jun 19, 2026
Merged

Add vision (image understanding) web server samples for C#, JS, Rust#821
samuel100 merged 1 commit into
mainfrom
natke/vision-samples-cs-js-rust

Conversation

@natke

@natke natke commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Adds three new samples demonstrating image understanding via the Foundry Local local web server (Responses API) using the qwen3.5-0.8b vision model:

  • samples/cs/foundry-local-web-server-responses-vision
  • samples/js/web-server-responses-vision-example
  • samples/rust/foundry-local-webserver-responses-vision

Each sample initializes the SDK, downloads/loads a vision-capable model, starts the local web service, sends a streaming Responses API request with a base64-encoded image, and prints the streamed assistant output.

Also updates the language-level READMEs and root samples README to list the new samples, and bumps the Rust workspace Cargo.toml.

Rust fix: removed reqwest .timeout(Duration::from_secs(0)) — reqwest treats a zero Duration as 'expire immediately', not 'no timeout', causing every request to fail with TimedOut.

JS sample notes:

  • Removed foundry-local-sdk-winml from optionalDependencies so the standard installer ships the Core dylib on macOS/Linux (winml installer has no payload for those platforms).
  • Use model.isCached (property getter) instead of await model.isCached().

Adds three new samples demonstrating image understanding via the
Foundry Local local web server (Responses API) using the
qwen3.5-0.8b vision model:

- samples/cs/foundry-local-web-server-responses-vision
- samples/js/web-server-responses-vision-example
- samples/rust/foundry-local-webserver-responses-vision

Each sample initializes the SDK, downloads/loads a vision-capable
model, starts the local web service, sends a streaming Responses
API request with a base64-encoded image, and prints the streamed
assistant output.

Also updates the language-level READMEs and root samples README to
list the new samples, and bumps the Rust workspace Cargo.toml.

Rust fix: removed reqwest `.timeout(Duration::from_secs(0))` —
reqwest treats a zero Duration as 'expire immediately', not
'no timeout', causing every request to fail with TimedOut.

JS sample notes:
- Removed `foundry-local-sdk-winml` from optionalDependencies so
  the standard installer ships the Core dylib on macOS/Linux
  (winml installer has no payload for those platforms).
- Use `model.isCached` (property getter) instead of
  `await model.isCached()`.

Verified end-to-end on macOS (darwin-arm64) with two images.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 19, 2026 01:20
@vercel

vercel Bot commented Jun 19, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
foundry-local Ready Ready Preview, Comment Jun 19, 2026 1:20am

Request Review

@natke natke requested review from samuel100 and removed request for Copilot June 19, 2026 01:20
@samuel100 samuel100 merged commit e3c123a into main Jun 19, 2026
62 of 63 checks passed
@samuel100 samuel100 deleted the natke/vision-samples-cs-js-rust branch June 19, 2026 09:16
bmehta001 added a commit that referenced this pull request Jun 19, 2026
The #821 web-server vision sample was added with the old WinML/non-WinML flavor
split (net9.0-windows10.0.18362.0 + Microsoft.AI.Foundry.Local.WinML on Windows,
base package elsewhere). Collapse it to the unified pattern used by every other
C# sample: a single net9.0 target and a single central-managed
Microsoft.AI.Foundry.Local PackageReference. Builds against the unified package
alongside all 14 C# samples.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
bmehta001 added a commit that referenced this pull request Jun 22, 2026
The #821 web-server vision sample was added with the old WinML/non-WinML flavor
split (net9.0-windows10.0.18362.0 + Microsoft.AI.Foundry.Local.WinML on Windows,
base package elsewhere). Collapse it to the unified pattern used by every other
C# sample: a single net9.0 target and a single central-managed
Microsoft.AI.Foundry.Local PackageReference. Builds against the unified package
alongside all 14 C# samples.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
bmehta001 added a commit that referenced this pull request Jun 30, 2026
#824)

## Summary

Collapses the separate **WinML** and **non-WinML** SDK flavors into a
**single package per SDK** (C#, Python, JS). Consumers no longer pick
between a `.WinML` SKU and a base SKU: on Windows the reg-free **WinML
2.x EP catalog** is always available, and other platforms are
unaffected.

## What changed

- **native** — always enable the WinML EP catalog on Windows; drop the
build-flavor split.
- **C#** — single `Microsoft.AI.Foundry.Local` package; drop the
`.WinML` SKU and the `UseWinML` switch.
- **Python** — single wheel; drop the WinML variant.
- **JS** — bundle the WinML 2.x runtime in the npm package on Windows.
- **macOS** — simplify ORT dylib staging to mirror Linux.
- **CI (`.pipelines/v2`)** — collapse the WinML/non-WinML matrix into
one build per SDK.
- **samples (C#)** — use the unified package; central package management
via `Directory.Packages.props`.
- **docs / www** — describe the unified package; one install command per
SDK in the download dropdown.
- **JS exit fix** — clean process exit after loading a native Manager
(`beforeExit`/`exit` handlers), avoiding the ORT-teardown crash on
graceful Node exit.

## Notes / follow-ups

- Rebased onto `main` (picks up #813 `sdk_legacy` removal, #821 vision
samples, #810 npm bump, #806).
- The #821 vision samples (C#/JS/Rust) landed after this branch and are
**not yet** migrated to the unified package / central package management
— follow-up needed.
- **Draft**: pending CI (multi-SDK pack + build) verification.

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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