@@ -52,24 +52,85 @@ const ORT_NIGHTLY_FEED = 'https://pkgs.dev.azure.com/aiinfra/PublicPackages/_pac
5252// Otherwise use the standard NuGet.org feed.
5353const CORE_FEED = useNightly ? ORT_NIGHTLY_FEED : NUGET_FEED ;
5454
55- const ARTIFACTS = [
56- {
57- name : useWinML ? 'Microsoft.AI.Foundry.Local.Core.WinML' : 'Microsoft.AI.Foundry.Local.Core' ,
58- version : useNightly ? undefined : useWinML ? '0.9.0.2-dev-20260226T191541-2b332047' : '0.9.0-dev-20260227T222239-2a3af92' , // Set later using resolveLatestVersion if undefined
59- feed : ORT_NIGHTLY_FEED
60- } ,
61- {
62- name : os . platform ( ) === 'linux' ? 'Microsoft.ML.OnnxRuntime.Gpu.Linux' : 'Microsoft.ML.OnnxRuntime.Foundry' ,
63- version : os . platform ( ) === 'linux' ? '1.24.1' : useWinML ? '1.23.2.3' : '1.24.1.1' ,
64- feed : NUGET_FEED
65- } ,
66- {
67- name : useWinML ? 'Microsoft.ML.OnnxRuntimeGenAI.WinML' : 'Microsoft.ML.OnnxRuntimeGenAI.Foundry' ,
68- version : '0.12.1' ,
69- feed : NUGET_FEED
70- }
55+ const FOUNDRY_LOCAL_CORE_ARTIFACT = {
56+ name : 'Microsoft.AI.Foundry.Local.Core' ,
57+ version : '0.9.0.8-rc3' ,
58+ feed : ORT_NIGHTLY_FEED ,
59+ nightly : useNightly
60+ }
61+
62+ const FOUNDRY_LOCAL_CORE_WINML_ARTIFACT = {
63+ name : 'Microsoft.AI.Foundry.Local.Core.WinML' ,
64+ version : '0.9.0.8-rc3' ,
65+ feed : ORT_NIGHTLY_FEED ,
66+ nightly : useNightly
67+ }
68+
69+ const ONNX_RUNTIME_FOUNDRY_ARTIFACT = {
70+ name : 'Microsoft.ML.OnnxRuntime.Foundry' ,
71+ version : '1.24.3' ,
72+ feed : NUGET_FEED ,
73+ nightly : false
74+ }
75+
76+ const ONNX_RUNTIME_WINML_ARTIFACT = {
77+ name : 'Microsoft.ML.OnnxRuntime.Foundry' ,
78+ version : '1.23.2.3' ,
79+ feed : NUGET_FEED ,
80+ nightly : false
81+ }
82+
83+ const ONNX_RUNTIME_LINUX_ARTIFACT = {
84+ name : 'Microsoft.ML.OnnxRuntime.Gpu.Linux' ,
85+ version : '1.24.3' ,
86+ feed : NUGET_FEED ,
87+ nightly : false
88+ }
89+
90+ const ONNX_RUNTIME_GENAI_FOUNDRY_ARTIFACT = {
91+ name : 'Microsoft.ML.OnnxRuntimeGenAI.Foundry' ,
92+ version : '0.12.2' ,
93+ feed : NUGET_FEED ,
94+ nightly : false
95+ }
96+
97+ const ONNX_RUNTIME_GENAI_WINML_ARTIFACT = {
98+ name : 'Microsoft.ML.OnnxRuntimeGenAI.WinML' ,
99+ version : '0.12.2' ,
100+ feed : NUGET_FEED ,
101+ nightly : false
102+ }
103+
104+ const WINML_ARTIFACTS = [
105+ FOUNDRY_LOCAL_CORE_WINML_ARTIFACT ,
106+ ONNX_RUNTIME_WINML_ARTIFACT ,
107+ ONNX_RUNTIME_GENAI_WINML_ARTIFACT
108+ ] ;
109+
110+ const NON_WINML_ARTIFACTS = [
111+ FOUNDRY_LOCAL_CORE_ARTIFACT ,
112+ ONNX_RUNTIME_FOUNDRY_ARTIFACT ,
113+ ONNX_RUNTIME_GENAI_FOUNDRY_ARTIFACT
114+ ] ;
115+
116+ const LINUX_ARTIFACTS = [
117+ FOUNDRY_LOCAL_CORE_ARTIFACT ,
118+ ONNX_RUNTIME_LINUX_ARTIFACT ,
119+ ONNX_RUNTIME_GENAI_FOUNDRY_ARTIFACT
71120] ;
72121
122+ let ARTIFACTS = [ ] ;
123+ if ( useWinML ) {
124+ console . log ( `[foundry-local] Using WinML artifacts...` ) ;
125+ ARTIFACTS = WINML_ARTIFACTS ;
126+ } else if ( os . platform ( ) === 'linux' ) {
127+ console . log ( `[foundry-local] Using Linux GPU artifacts...` ) ;
128+ ARTIFACTS = LINUX_ARTIFACTS ;
129+ } else {
130+ console . log ( `[foundry-local] Using standard artifacts...` ) ;
131+ ARTIFACTS = NON_WINML_ARTIFACTS ;
132+ }
133+
73134// Check if already installed
74135if ( fs . existsSync ( BIN_DIR ) && REQUIRED_FILES . every ( f => fs . existsSync ( path . join ( BIN_DIR , f ) ) ) ) {
75136 if ( useNightly ) {
@@ -215,7 +276,8 @@ async function installPackage(artifact, tempDir) {
215276
216277 // Resolve version if not specified
217278 let pkgVer = artifact . version ;
218- if ( ! pkgVer ) {
279+ let isNightly = artifact . nightly ;
280+ if ( isNightly ) {
219281 console . log ( ` Resolving latest version for ${ pkgName } ...` ) ;
220282 pkgVer = await resolveLatestVersion ( feedUrl , pkgName ) ;
221283 }
@@ -271,29 +333,12 @@ async function installPackage(artifact, tempDir) {
271333 }
272334}
273335
274- // ORT 1.24.1 has a bug: https://github.com/microsoft/onnxruntime/issues/27263
275- // Resolve it by creating a symlink to the correct binary on Linux and macOS.
276- function createOnnxRuntimeSymlinks ( ) {
277- if ( os . platform ( ) === 'win32' ) return ;
278-
279- const ext = os . platform ( ) === 'darwin' ? '.dylib' : '.so' ;
280- const libName = `libonnxruntime${ ext } ` ;
281- const linkName = `onnxruntime.dll` ;
282- const libPath = path . join ( BIN_DIR , libName ) ;
283- const linkPath = path . join ( BIN_DIR , linkName ) ;
284- if ( fs . existsSync ( libPath ) && ! fs . existsSync ( linkPath ) ) {
285- fs . symlinkSync ( libName , linkPath ) ;
286- console . log ( `[foundry-local] Created symlink: ${ linkName } -> ${ libName } ` ) ;
287- }
288- }
289-
290336async function main ( ) {
291337 const tempDir = fs . mkdtempSync ( path . join ( os . tmpdir ( ) , 'foundry-install-' ) ) ;
292338 try {
293339 for ( const artifact of ARTIFACTS ) {
294340 await installPackage ( artifact , tempDir ) ;
295341 }
296- createOnnxRuntimeSymlinks ( ) ;
297342 console . log ( '[foundry-local] ✓ Installation complete.' ) ;
298343 } catch ( e ) {
299344 console . error ( `[foundry-local] Installation failed: ${ e . message } ` ) ;
0 commit comments