The SDK currently defaults to attempting to connect to the LM Studio app instance on port 1234 (the default HTTP REST API server port, which also supports the websocket API the SDK uses).
Having that server instance running is optional, so if no user specified port is given, the SDK should instead be checking the "always on" API server ports defined in https://github.com/lmstudio-ai/lmstudio-js/blob/main/packages/lms-common/src/apiServerPorts.ts (the LM Studio app will start the API server on the local loopback interface using the first of those ports which is free).
The SDK currently defaults to attempting to connect to the LM Studio app instance on port 1234 (the default HTTP REST API server port, which also supports the websocket API the SDK uses).
Having that server instance running is optional, so if no user specified port is given, the SDK should instead be checking the "always on" API server ports defined in https://github.com/lmstudio-ai/lmstudio-js/blob/main/packages/lms-common/src/apiServerPorts.ts (the LM Studio app will start the API server on the local loopback interface using the first of those ports which is free).