Skip to content

Commit a86d902

Browse files
committed
updated alias or model id in SDK
1 parent 8d718d7 commit a86d902

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

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

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Available options:
3838

3939
| Method | Signature | Description |
4040
|-----------------------|---------------------------|--------------------------------------------------|
41-
| `init()` | `(modelAliasOrId?: string) => Promise<void>` | Initializes the SDK and optionally loads a model. |
41+
| `init()` | `(aliasOrModelId?: string) => Promise<void>` | Initializes the SDK and optionally loads a model. |
4242
| `isServiceRunning()` | `() => Promise<boolean>` | Checks if the Foundry Local service is running. |
4343
| `startService()` | `() => Promise<void>` | Starts the Foundry Local service. |
4444
| `serviceUrl` | `string` | The base URL of the Foundry Local service. |
@@ -52,7 +52,7 @@ Available options:
5252
|---------------------------|---------------------------------------------------------------------------|--------------------------------------------------|
5353
| `listCatalogModels()` | `() => Promise<FoundryModelInfo[]>` | Lists all available models in the catalog. |
5454
| `refreshCatalog()` | `() => Promise<void>` | Refreshes the model catalog. |
55-
| `getModelInfo()` | `(modelAliasOrId: string, throwOnNotFound = false) => Promise<FoundryModelInfo \| null>` | Gets model info by alias or ID. |
55+
| `getModelInfo()` | `(aliasOrModelId: string, throwOnNotFound = false) => Promise<FoundryModelInfo \| null>` | Gets model info by alias or ID. |
5656

5757

5858
### Cache Management
@@ -67,9 +67,9 @@ Available options:
6767

6868
| Method | Signature | Description |
6969
|-------------------------------|---------------------------------------------------------------------------|--------------------------------------------------|
70-
| `downloadModel()` | `(modelAliasOrId: string, force = false, onProgress?) => Promise<FoundryModelInfo>` | Downloads a model to the local cache. |
71-
| `loadModel()` | `(modelAliasOrId: string, ttl = 600) => Promise<FoundryModelInfo>` | Loads a model into the inference server. |
72-
| `unloadModel()` | `(modelAliasOrId: string, force = false) => Promise<void>` | Unloads a model from the inference server. |
70+
| `downloadModel()` | `(aliasOrModelId: string, force = false, onProgress?) => Promise<FoundryModelInfo>` | Downloads a model to the local cache. |
71+
| `loadModel()` | `(aliasOrModelId: string, ttl = 600) => Promise<FoundryModelInfo>` | Loads a model into the inference server. |
72+
| `unloadModel()` | `(aliasOrModelId: string, force = false) => Promise<void>` | Unloads a model from the inference server. |
7373
| `listLoadedModels()` | `() => Promise<FoundryModelInfo[]>` | Lists all models currently loaded in the service.|
7474

7575
## Example Usage
@@ -83,12 +83,12 @@ import { FoundryLocalManager } from "foundry-local-sdk";
8383
// to your end-user's device.
8484
// TIP: You can find a list of available models by running the
8585
// following command in your terminal: `foundry model list`.
86-
const modelAlias = "deepseek-r1-1.5b";
86+
const alias = "deepseek-r1-1.5b";
8787

8888
const manager = new FoundryLocalManager()
8989

9090
// Initialize the SDK and optionally load a model
91-
const modelInfo = await manager.init(modelAlias)
91+
const modelInfo = await manager.init(alias)
9292
console.log("Model Info:", modelInfo)
9393

9494
// Check if the service is running
@@ -99,8 +99,8 @@ console.log(`Service running: ${isRunning}`)
9999
const catalog = await manager.listCatalogModels()
100100

101101
// Download and load a model
102-
await manager.downloadModel(modelAlias)
103-
await manager.loadModel(modelAlias)
102+
await manager.downloadModel(alias)
103+
await manager.loadModel(alias)
104104

105105
// List models in cache
106106
const localModels = await manager.listLocalModels()
@@ -109,7 +109,7 @@ const localModels = await manager.listLocalModels()
109109
const loaded = await manager.listLoadedModels()
110110

111111
// Unload a model
112-
await manager.unloadModel(modelAlias)
112+
await manager.unloadModel(alias)
113113
```
114114

115115
---
@@ -132,15 +132,15 @@ import { FoundryLocalManager } from "foundry-local-sdk";
132132
// to your end-user's device.
133133
// TIP: You can find a list of available models by running the
134134
// following command in your terminal: `foundry model list`.
135-
const modelAlias = "deepseek-r1-1.5b";
135+
const alias = "deepseek-r1-1.5b";
136136

137137
// Create a FoundryLocalManager instance. This will start the Foundry
138138
// Local service if it is not already running.
139139
const foundryLocalManager = new FoundryLocalManager()
140140

141141
// Initialize the manager with a model. This will download the model
142142
// if it is not already present on the user's device.
143-
const modelInfo = await foundryLocalManager.init(modelAlias)
143+
const modelInfo = await foundryLocalManager.init(alias)
144144
console.log("Model Info:", modelInfo)
145145

146146
const openai = new OpenAI({
@@ -199,15 +199,15 @@ const endpoint = "ENDPOINT"
199199

200200
const manager = new FoundryLocalManager({serviceUrl: endpoint})
201201

202-
const modelAlias = 'deepseek-r1-1.5b'
202+
const alias = 'deepseek-r1-1.5b'
203203

204204
// Get all available models
205205
const catalog = await manager.listCatalogModels()
206206
console.log("Available models in catalog:", catalog)
207207

208208
// Download and load a specific model
209-
await manager.downloadModel(modelAlias)
210-
await manager.loadModel(modelAlias)
209+
await manager.downloadModel(alias)
210+
await manager.loadModel(alias)
211211

212212
// View models in your local cache
213213
const localModels = await manager.listLocalModels()
@@ -218,5 +218,5 @@ const loaded = await manager.listLoadedModels()
218218
console.log("Loaded models in inference service:", loaded)
219219

220220
// Unload a model when finished
221-
await manager.unloadModel(modelAlias)
221+
await manager.unloadModel(alias)
222222
```

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ The `FoundryLocalManager` class provides methods to manage models, cache, and th
2727
from foundry_local import FoundryLocalManager
2828

2929
# Initialize and optionally bootstrap with a model
30-
manager = FoundryLocalManager(model_id_or_alias=None, bootstrap=True)
30+
manager = FoundryLocalManager(alias_or_model_id=None, bootstrap=True)
3131
```
3232

33-
- `model_id_or_alias`: (optional) Model ID or alias to download and load at startup.
33+
- `alias_or_model_id`: (optional) Alias or Model ID to download and load at startup.
3434
- `bootstrap`: (default True) If True, starts the service if not running and loads the model if provided.
3535

3636
### Service Management
@@ -49,7 +49,7 @@ manager = FoundryLocalManager(model_id_or_alias=None, bootstrap=True)
4949
|---------------------------|---------------------------------------------------|--------------------------------------------------|
5050
| `list_catalog_models()` | `() -> list[FoundryModelInfo]` | Lists all available models in the catalog. |
5151
| `refresh_catalog()` | `() -> None` | Refreshes the model catalog. |
52-
| `get_model_info()` | `(model_alias_or_id: str, raise_on_not_found=False) -> FoundryModelInfo or None` | Gets model info by alias or ID. |
52+
| `get_model_info()` | `(alias_or_model_id: str, raise_on_not_found=False) -> FoundryModelInfo or None` | Gets model info by alias or ID. |
5353

5454
### Cache Management
5555

@@ -62,9 +62,9 @@ manager = FoundryLocalManager(model_id_or_alias=None, bootstrap=True)
6262

6363
| Method | Signature | Description |
6464
|-------------------------------|---------------------------------------------------------------------------|--------------------------------------------------|
65-
| `download_model()` | `(model_alias_or_id: str, token: str = None, force: bool = False) -> FoundryModelInfo` | Downloads a model to the local cache. |
66-
| `load_model()` | `(model_alias_or_id: str, ttl: int = 600) -> FoundryModelInfo` | Loads a model into the inference server. |
67-
| `unload_model()` | `(model_alias_or_id: str, force: bool = False) -> None` | Unloads a model from the inference server. |
65+
| `download_model()` | `(alias_or_model_id: str, token: str = None, force: bool = False) -> FoundryModelInfo` | Downloads a model to the local cache. |
66+
| `load_model()` | `(alias_or_model_id: str, ttl: int = 600) -> FoundryModelInfo` | Loads a model into the inference server. |
67+
| `unload_model()` | `(alias_or_model_id: str, force: bool = False) -> None` | Unloads a model from the inference server. |
6868
| `list_loaded_models()` | `() -> list[FoundryModelInfo]` | Lists all models currently loaded in the service.|
6969

7070
## Example Usage

0 commit comments

Comments
 (0)