@@ -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
8888const 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 )
9292console .log (" Model Info:" , modelInfo)
9393
9494// Check if the service is running
@@ -99,8 +99,8 @@ console.log(`Service running: ${isRunning}`)
9999const 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
106106const localModels = await manager .listLocalModels ()
@@ -109,7 +109,7 @@ const localModels = await manager.listLocalModels()
109109const 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.
139139const 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 )
144144console .log (" Model Info:" , modelInfo)
145145
146146const openai = new OpenAI ({
@@ -199,15 +199,15 @@ const endpoint = "ENDPOINT"
199199
200200const 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
205205const catalog = await manager .listCatalogModels ()
206206console .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
213213const localModels = await manager .listLocalModels ()
@@ -218,5 +218,5 @@ const loaded = await manager.listLoadedModels()
218218console .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` ` `
0 commit comments