From a6758cddfab2bac07fa34d66ad981d66899c2f46 Mon Sep 17 00:00:00 2001 From: Govind Kamtamneni Date: Fri, 6 Feb 2026 05:47:33 -0800 Subject: [PATCH 1/5] docs: add Foundry Local as a BYOK provider Add Foundry Local (Microsoft on-device inference) to the BYOK documentation: - Supported Providers table entry - Example configuration section with SDK bootstrap snippet - Provider-Specific Limitations table entry - Troubleshooting section for connection issues --- docs/auth/byok.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/docs/auth/byok.md b/docs/auth/byok.md index 6c836743..ab121f14 100644 --- a/docs/auth/byok.md +++ b/docs/auth/byok.md @@ -10,6 +10,7 @@ BYOK allows you to use the Copilot SDK with your own API keys from model provide | Azure OpenAI / Azure AI Foundry | `"azure"` | Azure-hosted models | | Anthropic | `"anthropic"` | Claude models | | Ollama | `"openai"` | Local models via OpenAI-compatible API | +| Foundry Local | `"openai"` | On-device inference via Microsoft's OpenAI-compatible local server | | Other OpenAI-compatible | `"openai"` | vLLM, LiteLLM, etc. | ## Quick Start: Azure AI Foundry @@ -250,6 +251,27 @@ provider: { } ``` +### Foundry Local (On-Device) + +[Foundry Local](https://github.com/microsoft/Foundry-Local) runs AI models on-device without requiring an Azure subscription. It exposes an OpenAI-compatible API at `http://localhost:5272/v1`. + +Use the [Foundry Local SDK](https://github.com/microsoft/Foundry-Local#-integrate-with-your-applications-using-the-sdk) to bootstrap the service and model, then point the Copilot SDK at the local endpoint: + +```typescript +// Bootstrap: npm install foundry-local-sdk +// import { FoundryLocalManager } from "foundry-local-sdk"; +// const manager = new FoundryLocalManager(); +// const modelInfo = await manager.init("phi-3.5-mini"); + +provider: { + type: "openai", + baseUrl: "http://localhost:5272/v1", // Default Foundry Local endpoint + apiKey: manager.apiKey, // Provided by Foundry Local SDK +} +``` + +> **Note:** Foundry Local must be [installed separately](https://github.com/microsoft/Foundry-Local#installing). Run `foundry model run phi-3.5-mini` to download and start a model. + ### Anthropic ```typescript @@ -301,6 +323,7 @@ Some Copilot features may behave differently with BYOK: |----------|-------------| | Azure AI Foundry | No Entra ID auth; must use API keys | | Ollama | No API key; local only; model support varies | +| Foundry Local | Local only; requires [Foundry Local installed](https://github.com/microsoft/Foundry-Local#installing); model catalog limited to Foundry Local models; REST API is in preview | | OpenAI | Subject to OpenAI rate limits and quotas | ## Troubleshooting @@ -364,6 +387,28 @@ curl http://localhost:11434/v1/models ollama serve ``` +### Connection Refused (Foundry Local) + +Ensure Foundry Local is installed and the service is running: + +```bash +# Check if Foundry Local is installed +foundry --version + +# List available models +foundry model ls + +# Start a model (downloads if not cached) +foundry model run phi-3.5-mini + +# Check the service endpoint +curl http://localhost:5272/v1/models +``` + +If not installed: +- **Windows**: `winget install Microsoft.FoundryLocal` +- **macOS**: `brew install microsoft/foundrylocal/foundrylocal` + ### Authentication Failed 1. Verify your API key is correct and not expired From 938f863acb72e489fceabe4d603960bc58474685 Mon Sep 17 00:00:00 2001 From: Govind Kamtamneni Date: Fri, 6 Feb 2026 05:53:36 -0800 Subject: [PATCH 2/5] fix: add docs-validate skip directive for Foundry Local code block The TypeScript snippet contains bootstrap comments and a bare object literal that isn't standalone-valid TS, same pattern used elsewhere in the file (e.g. Azure endpoint type confusion examples). --- docs/auth/byok.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/auth/byok.md b/docs/auth/byok.md index ab121f14..d711862d 100644 --- a/docs/auth/byok.md +++ b/docs/auth/byok.md @@ -257,6 +257,7 @@ provider: { Use the [Foundry Local SDK](https://github.com/microsoft/Foundry-Local#-integrate-with-your-applications-using-the-sdk) to bootstrap the service and model, then point the Copilot SDK at the local endpoint: + ```typescript // Bootstrap: npm install foundry-local-sdk // import { FoundryLocalManager } from "foundry-local-sdk"; From e4b9e4bf8634bc71c28096947ad0a1f7598667e0 Mon Sep 17 00:00:00 2001 From: Govind Kamtamneni Date: Fri, 6 Feb 2026 09:54:07 -0800 Subject: [PATCH 3/5] docs: use gpt-oss-20b as the example Foundry Local model --- docs/auth/byok.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/auth/byok.md b/docs/auth/byok.md index d711862d..6bfea6ac 100644 --- a/docs/auth/byok.md +++ b/docs/auth/byok.md @@ -262,7 +262,7 @@ Use the [Foundry Local SDK](https://github.com/microsoft/Foundry-Local#-integrat // Bootstrap: npm install foundry-local-sdk // import { FoundryLocalManager } from "foundry-local-sdk"; // const manager = new FoundryLocalManager(); -// const modelInfo = await manager.init("phi-3.5-mini"); +// const modelInfo = await manager.init("gpt-oss-20b"); provider: { type: "openai", @@ -271,7 +271,7 @@ provider: { } ``` -> **Note:** Foundry Local must be [installed separately](https://github.com/microsoft/Foundry-Local#installing). Run `foundry model run phi-3.5-mini` to download and start a model. +> **Note:** Foundry Local must be [installed separately](https://github.com/microsoft/Foundry-Local#installing). Run `foundry model run gpt-oss-20b` to download and start a model. ### Anthropic @@ -400,7 +400,7 @@ foundry --version foundry model ls # Start a model (downloads if not cached) -foundry model run phi-3.5-mini +foundry model run gpt-oss-20b # Check the service endpoint curl http://localhost:5272/v1/models From d895c0c4579a32d17e890e245cfcada1349076ba Mon Sep 17 00:00:00 2001 From: Govind Kamtamneni Date: Fri, 6 Feb 2026 09:58:06 -0800 Subject: [PATCH 4/5] docs: align Foundry Local example with upstream integration guide Use manager.endpoint instead of hardcoded URL, add wireApi: completions, and link to the full integration guide and working sample in the Foundry-Local repo (microsoft/Foundry-Local#417). --- docs/auth/byok.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/auth/byok.md b/docs/auth/byok.md index 6bfea6ac..a77524de 100644 --- a/docs/auth/byok.md +++ b/docs/auth/byok.md @@ -266,13 +266,16 @@ Use the [Foundry Local SDK](https://github.com/microsoft/Foundry-Local#-integrat provider: { type: "openai", - baseUrl: "http://localhost:5272/v1", // Default Foundry Local endpoint + baseUrl: manager.endpoint, // e.g., "http://localhost:5272/v1" apiKey: manager.apiKey, // Provided by Foundry Local SDK + wireApi: "completions", // Foundry Local uses Chat Completions API } ``` > **Note:** Foundry Local must be [installed separately](https://github.com/microsoft/Foundry-Local#installing). Run `foundry model run gpt-oss-20b` to download and start a model. +For a complete walkthrough including tool calling, streaming, and multi-turn conversations, see the [Foundry Local Copilot SDK integration guide](https://github.com/microsoft/Foundry-Local/blob/main/docs/copilot-sdk-integration.md) and the [working Node.js sample](https://github.com/microsoft/Foundry-Local/tree/main/samples/js/copilot-sdk-foundry-local). + ### Anthropic ```typescript From 5f2929a26d82ae2917dfc1f7905287cf535d0056 Mon Sep 17 00:00:00 2001 From: Govind Kamtamneni Date: Fri, 6 Feb 2026 11:09:52 -0800 Subject: [PATCH 5/5] docs: use phi-4-mini as example model to match upstream Foundry-Local PR --- docs/auth/byok.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/auth/byok.md b/docs/auth/byok.md index a77524de..e2064ada 100644 --- a/docs/auth/byok.md +++ b/docs/auth/byok.md @@ -262,7 +262,7 @@ Use the [Foundry Local SDK](https://github.com/microsoft/Foundry-Local#-integrat // Bootstrap: npm install foundry-local-sdk // import { FoundryLocalManager } from "foundry-local-sdk"; // const manager = new FoundryLocalManager(); -// const modelInfo = await manager.init("gpt-oss-20b"); +// const modelInfo = await manager.init("phi-4-mini"); provider: { type: "openai", @@ -272,7 +272,7 @@ provider: { } ``` -> **Note:** Foundry Local must be [installed separately](https://github.com/microsoft/Foundry-Local#installing). Run `foundry model run gpt-oss-20b` to download and start a model. +> **Note:** Foundry Local must be [installed separately](https://github.com/microsoft/Foundry-Local#installing). Run `foundry model run phi-4-mini` to download and start a model. For a complete walkthrough including tool calling, streaming, and multi-turn conversations, see the [Foundry Local Copilot SDK integration guide](https://github.com/microsoft/Foundry-Local/blob/main/docs/copilot-sdk-integration.md) and the [working Node.js sample](https://github.com/microsoft/Foundry-Local/tree/main/samples/js/copilot-sdk-foundry-local). @@ -403,7 +403,7 @@ foundry --version foundry model ls # Start a model (downloads if not cached) -foundry model run gpt-oss-20b +foundry model run phi-4-mini # Check the service endpoint curl http://localhost:5272/v1/models