Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ 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 binds to a non-localhost address instead of localhost. The API access URL updates accordingly, which you can use in your applications.

<img src="/assets/marketing/docs/serve-local-network.png" style="" data-caption="Serve LM Studio API Server on Local Network" />
<Callout type="warning" title="Heads Up">
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.
</Callout>

<img src="/assets/marketing/docs/serve-local-network.png" data-caption="Serve LM Studio API Server on Local Network" />

To make the server available on your local network via the CLI, run:

```
lms server start --bind 0.0.0.0
```
20 changes: 19 additions & 1 deletion 3_cli/1_serve/server-start.md → 3_cli/1_serve/server-start.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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 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
Expand All @@ -44,7 +48,21 @@ 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.
<Callout type="warning" title="Warning - Security Risk">
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.
</Callout>

### Bind to a network address

To make the server available on your local network, run:

<Callout type="warning" title="Heads Up">
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.
</Callout>

```shell
lms server start --bind 0.0.0.0
```

### Check the server status

Expand Down
Loading