From ba9dea0022e0b2d98b0c057a18a0a307c05d16f8 Mon Sep 17 00:00:00 2001 From: Rugved Somwanshi Date: Fri, 15 May 2026 19:24:41 +0530 Subject: [PATCH 1/6] Add --bind docs --- 1_developer/0_core/0_server/serve-on-network.md | 6 ++++++ 3_cli/1_serve/server-start.md | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/1_developer/0_core/0_server/serve-on-network.md b/1_developer/0_core/0_server/serve-on-network.md index 903ec55..72a189f 100644 --- a/1_developer/0_core/0_server/serve-on-network.md +++ b/1_developer/0_core/0_server/serve-on-network.md @@ -17,3 +17,9 @@ This is useful for scenarios where you want to: Once enabled, the server will bind to your local network IP address instead of localhost. The API access URL will be updated accordingly which you can use in your applications. + +To make the server available on your local network via the CLI, run: + +``` +lms server start --bind 0.0.0.0 +``` diff --git a/3_cli/1_serve/server-start.md b/3_cli/1_serve/server-start.md index 19250ea..fe285c1 100644 --- a/3_cli/1_serve/server-start.md +++ b/3_cli/1_serve/server-start.md @@ -18,6 +18,10 @@ The `lms server start` command launches the LM Studio local server, allowing you type: "flag" optional: true description: "Enable CORS support for web application development. When not set, CORS is disabled" +- name: "--bind" + type: "string" + optional: true + description: "Network address to bind the server to. Use \"0.0.0.0\" to accept connections from the local network, or \"127.0.0.1\" (default) for localhost only. Can also be set via the LMS_SERVER_HOST environment variable." ``` ## Start the server @@ -46,6 +50,14 @@ lms server start --cors Note that enabling CORS may expose your server to security risks, so use it only when necessary. +### Bind to a network address + +To make the server available on your local network, run: + +```shell +lms server start --bind 0.0.0.0 +``` + ### Check the server status See [`lms server status`](/docs/cli/serve/server-status) for more information on checking the status of the server. From 5a9afc41b3cebc816543af645966e7711c204eeb Mon Sep 17 00:00:00 2001 From: Rugved Somwanshi Date: Fri, 15 May 2026 19:38:38 +0530 Subject: [PATCH 2/6] Add warning --- 1_developer/0_core/0_server/serve-on-network.md | 2 +- 3_cli/1_serve/server-start.md | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/1_developer/0_core/0_server/serve-on-network.md b/1_developer/0_core/0_server/serve-on-network.md index 72a189f..00b2a5d 100644 --- a/1_developer/0_core/0_server/serve-on-network.md +++ b/1_developer/0_core/0_server/serve-on-network.md @@ -14,7 +14,7 @@ This is useful for scenarios where you want to: - Let multiple people use a single LM Studio instance on the network. - Use the API from IoT devices, edge computing units, or other services in your local setup. -Once enabled, the server will bind to your local network IP address instead of localhost. The API access URL will be updated accordingly which you can use in your applications. +Once enabled, the server will bind to your local network IP address instead of localhost. Make sure you do this over a trusted network only. The API access URL will be updated accordingly which you can use in your applications. diff --git a/3_cli/1_serve/server-start.md b/3_cli/1_serve/server-start.md index fe285c1..07c3831 100644 --- a/3_cli/1_serve/server-start.md +++ b/3_cli/1_serve/server-start.md @@ -21,7 +21,7 @@ The `lms server start` command launches the LM Studio local server, allowing you - name: "--bind" type: "string" optional: true - description: "Network address to bind the server to. Use \"0.0.0.0\" to accept connections from the local network, or \"127.0.0.1\" (default) for localhost only. Can also be set via the LMS_SERVER_HOST environment variable." + description: "Network address to bind the server to. Use \"0.0.0.0\" to listen on all IPv4 interfaces, or \"127.0.0.1\" (default) for localhost only. Can also be set via the LMS_SERVER_HOST environment variable." ``` ## Start the server @@ -58,6 +58,8 @@ To make the server available on your local network, run: lms server start --bind 0.0.0.0 ``` +Any non-`127.0.0.1` bind exposes the server beyond `localhost`. The CLI shows a warning when you do this, and you should use it only on trusted networks. + ### Check the server status See [`lms server status`](/docs/cli/serve/server-status) for more information on checking the status of the server. From 477d890ac506b03b5e85054d765329143c607511 Mon Sep 17 00:00:00 2001 From: Rugved Somwanshi Date: Fri, 15 May 2026 19:56:08 +0530 Subject: [PATCH 3/6] Promote warnings to their own boxes --- .../{serve-on-network.md => serve-on-network.mdx} | 8 ++++++-- 3_cli/1_serve/{server-start.md => server-start.mdx} | 6 ++++-- 2 files changed, 10 insertions(+), 4 deletions(-) rename 1_developer/0_core/0_server/{serve-on-network.md => serve-on-network.mdx} (60%) rename 3_cli/1_serve/{server-start.md => server-start.mdx} (86%) diff --git a/1_developer/0_core/0_server/serve-on-network.md b/1_developer/0_core/0_server/serve-on-network.mdx similarity index 60% rename from 1_developer/0_core/0_server/serve-on-network.md rename to 1_developer/0_core/0_server/serve-on-network.mdx index 00b2a5d..62b97d3 100644 --- a/1_developer/0_core/0_server/serve-on-network.md +++ b/1_developer/0_core/0_server/serve-on-network.mdx @@ -14,9 +14,13 @@ This is useful for scenarios where you want to: - Let multiple people use a single LM Studio instance on the network. - Use the API from IoT devices, edge computing units, or other services in your local setup. -Once enabled, the server will bind to your local network IP address instead of localhost. Make sure you do this over a trusted network only. The API access URL will be updated accordingly which you can use in your applications. +Once enabled, the server binds to a non-localhost address instead of localhost. The API access URL updates accordingly, which you can use in your applications. - + +Any bind other than `127.0.0.1` exposes the server beyond `localhost`; we recommend enabling [authentication](/docs/developer/core/authentication). Only do this if you know what you're doing. + + + To make the server available on your local network via the CLI, run: diff --git a/3_cli/1_serve/server-start.md b/3_cli/1_serve/server-start.mdx similarity index 86% rename from 3_cli/1_serve/server-start.md rename to 3_cli/1_serve/server-start.mdx index 07c3831..ec36d6c 100644 --- a/3_cli/1_serve/server-start.md +++ b/3_cli/1_serve/server-start.mdx @@ -54,12 +54,14 @@ Note that enabling CORS may expose your server to security risks, so use it only To make the server available on your local network, run: + +Any bind other than `127.0.0.1` exposes the server beyond `localhost`; we recommend enabling [authentication](/docs/developer/core/authentication). Only do this if you know what you're doing. + + ```shell lms server start --bind 0.0.0.0 ``` -Any non-`127.0.0.1` bind exposes the server beyond `localhost`. The CLI shows a warning when you do this, and you should use it only on trusted networks. - ### Check the server status See [`lms server status`](/docs/cli/serve/server-status) for more information on checking the status of the server. From d80114cfb637205b1a9466890c2481019a6dc806 Mon Sep 17 00:00:00 2001 From: Rugved Somwanshi Date: Fri, 15 May 2026 19:57:40 +0530 Subject: [PATCH 4/6] Promote CORS warning too --- 3_cli/1_serve/server-start.mdx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/3_cli/1_serve/server-start.mdx b/3_cli/1_serve/server-start.mdx index ec36d6c..18d7f88 100644 --- a/3_cli/1_serve/server-start.mdx +++ b/3_cli/1_serve/server-start.mdx @@ -48,7 +48,9 @@ For usage with web applications or some VS Code extensions, you may need to enab lms server start --cors ``` -Note that enabling CORS may expose your server to security risks, so use it only when necessary. + +Enabling CORS can expose your server to security risks; we recommend enabling [authentication](/docs/developer/core/authentication). Only do this if you know what you're doing. + ### Bind to a network address From ba1e1979e2f3d65f658d7169283d53e79beff674 Mon Sep 17 00:00:00 2001 From: Rugved Somwanshi Date: Fri, 15 May 2026 20:05:43 +0530 Subject: [PATCH 5/6] Update server-start.mdx --- 3_cli/1_serve/server-start.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3_cli/1_serve/server-start.mdx b/3_cli/1_serve/server-start.mdx index 18d7f88..7c0aadd 100644 --- a/3_cli/1_serve/server-start.mdx +++ b/3_cli/1_serve/server-start.mdx @@ -48,7 +48,7 @@ For usage with web applications or some VS Code extensions, you may need to enab lms server start --cors ``` - + Enabling CORS can expose your server to security risks; we recommend enabling [authentication](/docs/developer/core/authentication). Only do this if you know what you're doing. From 95f2e8107f567747c6bb1301efd0e3b75bd137de Mon Sep 17 00:00:00 2001 From: Rugved Somwanshi Date: Fri, 15 May 2026 20:09:10 +0530 Subject: [PATCH 6/6] Update server-start.mdx --- 3_cli/1_serve/server-start.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3_cli/1_serve/server-start.mdx b/3_cli/1_serve/server-start.mdx index 7c0aadd..57a3267 100644 --- a/3_cli/1_serve/server-start.mdx +++ b/3_cli/1_serve/server-start.mdx @@ -48,7 +48,7 @@ For usage with web applications or some VS Code extensions, you may need to enab lms server start --cors ``` - + Enabling CORS can expose your server to security risks; we recommend enabling [authentication](/docs/developer/core/authentication). Only do this if you know what you're doing.