@@ -38,7 +38,7 @@ Available options:
38
38
39
39
| Method | Signature | Description |
40
40
| -----------------------| ---------------------------| --------------------------------------------------|
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. |
42
42
| ` isServiceRunning() ` | ` () => Promise<boolean> ` | Checks if the Foundry Local service is running. |
43
43
| ` startService() ` | ` () => Promise<void> ` | Starts the Foundry Local service. |
44
44
| ` serviceUrl ` | ` string ` | The base URL of the Foundry Local service. |
@@ -52,7 +52,7 @@ Available options:
52
52
| ---------------------------| ---------------------------------------------------------------------------| --------------------------------------------------|
53
53
| ` listCatalogModels() ` | ` () => Promise<FoundryModelInfo[]> ` | Lists all available models in the catalog. |
54
54
| ` 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. |
56
56
57
57
58
58
### Cache Management
@@ -67,9 +67,9 @@ Available options:
67
67
68
68
| Method | Signature | Description |
69
69
| -------------------------------| ---------------------------------------------------------------------------| --------------------------------------------------|
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. |
73
73
| ` listLoadedModels() ` | ` () => Promise<FoundryModelInfo[]> ` | Lists all models currently loaded in the service.|
74
74
75
75
## Example Usage
@@ -83,12 +83,12 @@ import { FoundryLocalManager } from "foundry-local-sdk";
83
83
// to your end-user's device.
84
84
// TIP: You can find a list of available models by running the
85
85
// following command in your terminal: `foundry model list`.
86
- const modelAlias = " deepseek-r1-1.5b" ;
86
+ const alias = " deepseek-r1-1.5b" ;
87
87
88
88
const manager = new FoundryLocalManager ()
89
89
90
90
// Initialize the SDK and optionally load a model
91
- const modelInfo = await manager .init (modelAlias )
91
+ const modelInfo = await manager .init (alias )
92
92
console .log (" Model Info:" , modelInfo)
93
93
94
94
// Check if the service is running
@@ -99,8 +99,8 @@ console.log(`Service running: ${isRunning}`)
99
99
const catalog = await manager .listCatalogModels ()
100
100
101
101
// 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 )
104
104
105
105
// List models in cache
106
106
const localModels = await manager .listLocalModels ()
@@ -109,7 +109,7 @@ const localModels = await manager.listLocalModels()
109
109
const loaded = await manager .listLoadedModels ()
110
110
111
111
// Unload a model
112
- await manager .unloadModel (modelAlias )
112
+ await manager .unloadModel (alias )
113
113
```
114
114
115
115
---
@@ -132,15 +132,15 @@ import { FoundryLocalManager } from "foundry-local-sdk";
132
132
// to your end-user's device.
133
133
// TIP: You can find a list of available models by running the
134
134
// following command in your terminal: `foundry model list`.
135
- const modelAlias = " deepseek-r1-1.5b" ;
135
+ const alias = " deepseek-r1-1.5b" ;
136
136
137
137
// Create a FoundryLocalManager instance. This will start the Foundry
138
138
// Local service if it is not already running.
139
139
const foundryLocalManager = new FoundryLocalManager ()
140
140
141
141
// Initialize the manager with a model. This will download the model
142
142
// 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 )
144
144
console .log (" Model Info:" , modelInfo)
145
145
146
146
const openai = new OpenAI ({
@@ -199,15 +199,15 @@ const endpoint = "ENDPOINT"
199
199
200
200
const manager = new FoundryLocalManager ({serviceUrl: endpoint})
201
201
202
- const modelAlias = ' deepseek-r1-1.5b'
202
+ const alias = ' deepseek-r1-1.5b'
203
203
204
204
// Get all available models
205
205
const catalog = await manager .listCatalogModels ()
206
206
console .log (" Available models in catalog:" , catalog)
207
207
208
208
// 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 )
211
211
212
212
// View models in your local cache
213
213
const localModels = await manager .listLocalModels ()
@@ -218,5 +218,5 @@ const loaded = await manager.listLoadedModels()
218
218
console .log (" Loaded models in inference service:" , loaded)
219
219
220
220
// Unload a model when finished
221
- await manager .unloadModel (modelAlias )
221
+ await manager .unloadModel (alias )
222
222
` ` `
0 commit comments