@@ -643,8 +643,11 @@ export function _buildServeCmd(f, modelName, backend) {
643643 // GPU list — read from gpus (button strip); fall back to gpu_id for
644644 // backward-compat with older saved presets that pre-date the removal.
645645 const gpuId = ( f . gpus || f . gpu_id || '' ) . toString ( ) . trim ( ) ;
646- const _isWin = _isWindows ( ) ;
647- const _localWindows = _isWin && ! _envState . remoteHost ;
646+ const _targetHost = Object . prototype . hasOwnProperty . call ( f , 'host' )
647+ ? String ( f . host || '' ) . trim ( )
648+ : String ( _envState . remoteHost || '' ) . trim ( ) ;
649+ const _isWin = _targetHost ? _isWindows ( _targetHost ) : _isWindows ( 'local' ) ;
650+ const _localWindows = _isWin && ! _targetHost ;
648651 const py = _isWin ? 'python' : 'python3' ;
649652 // CPU-only serve (-ngl 0): drop the GPU-only flags, otherwise the command
650653 // mixes "zero GPU layers" with CUDA unified-memory + flash-attn and fails to
@@ -667,7 +670,7 @@ export function _buildServeCmd(f, modelName, backend) {
667670 // with misleading prefixes.
668671 const _sb = String ( _hwfitCache ?. system ?. backend || '' ) . toLowerCase ( ) ;
669672 const _hwfitHost = String ( _hwfitCache ?. _scannedHost || '' ) ;
670- const _curHost = String ( _envState . remoteHost || '' ) ;
673+ const _curHost = _targetHost ;
671674 const _isCudaTarget = ( _sb === 'cuda' ) && ( _hwfitHost === _curHost ) ;
672675 const lcPrefix = ( ( ) => {
673676 let p = '' ;
0 commit comments