Skip to content

Commit 8ae019b

Browse files
committed
fixed the dynamic allocation of endpoint
1 parent d77298a commit 8ae019b

File tree

1 file changed

+16
-2
lines changed
  • articles/ai-foundry/foundry-local/includes/sdk-reference

1 file changed

+16
-2
lines changed

articles/ai-foundry/foundry-local/includes/sdk-reference/javascript.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,18 +172,32 @@ The SDK includes a browser-compatible version where you must specify the service
172172
```js
173173
import { FoundryLocalManager } from "foundry-local-sdk/browser"
174174

175-
const manager = new FoundryLocalManager({serviceUrl: "http://localhost:5272"})
175+
// Specify the service URL
176+
// Run the Foundry Local service using the CLI: `foundry service start`
177+
// and use the URL from the CLI output
178+
const endpoint = "ENDPOINT"
179+
180+
const manager = new FoundryLocalManager({serviceUrl: endpoint})
176181

177182
// Note: The `init`, `isServiceRunning`, and `startService` methods
178183
// are not available in the browser version
179184
```
180185
186+
> [!NOTE]
187+
> The browser version doesn't support the `init`, `isServiceRunning`, and `startService` methods. You must ensure that the Foundry Local service is running before using the SDK in a browser environment. You can start the service using the Foundry Local CLI: `foundry service start`. You can glean the service URL from the CLI output.
188+
189+
181190
#### Example Usage
182191
183192
```js
184193
import { FoundryLocalManager } from "foundry-local-sdk/browser"
185194

186-
const manager = new FoundryLocalManager({serviceUrl: "http://localhost:5272"})
195+
// Specify the service URL
196+
// Run the Foundry Local service using the CLI: `foundry service start`
197+
// and use the URL from the CLI output
198+
const endpoint = "ENDPOINT"
199+
200+
const manager = new FoundryLocalManager({serviceUrl: endpoint})
187201

188202
const modelAlias = 'deepseek-r1-1.5b'
189203

0 commit comments

Comments
 (0)