# Local Model Service Protocol (LMSP)

> LMSP is an open protocol for discovering and calling language models that run on your own device. It defines service discovery, a model catalog, streaming, persistent tasks and OpenAI compatibility.

Source: https://madeforagent.com/lmsp/
Language: en
Updated: 2026-11-08

## What LMSP does {#what}

LMSP (Local Model Service Protocol) is an open protocol for software that runs language models on a user's own device or local network, and for the clients that use that software.

A resident local service describes itself at a well-known address and lists its models. It answers generation requests with JSON or server-sent events, and runs long generations as persisted tasks that can be cancelled and followed again after a disconnect. The same service also speaks the OpenAI API, so the clients that exist today keep working.

LMSP does not replace the OpenAI API, Ollama or MCP. It combines their strengths in a protocol layer built for resident local services.

## At a glance {#glance}

| Topic | Summary |
| --- | --- |
| Default address | `http://127.0.0.1:17832` |
| Service description | `GET /.well-known/lmsp.json` |
| Core interface | `/lmsp/v1`, JSON over HTTP, streaming with server-sent events |
| Compatibility interfaces | `/v1` for OpenAI clients, optional `/api` for Ollama clients |
| Discovery | Manual address, probing of local addresses, optional mDNS and DNS-SD (`_lmsp._tcp.local.`) |
| Authentication | Bearer tokens obtained through local pairing |
| Persistence | Embedded SQLite, with tasks that survive a restart |
| Contract | OpenAPI 3.2 |

## Try it {#try}

If an LMSP service is running on your machine, this is the whole flow. Pair first to get a token, as described in [section 10.2](https://madeforagent.com/lmsp/1.0/security.md#pairing), and keep it in `LMSP_TOKEN`.

```sh
# 1. Discover the service
curl http://127.0.0.1:17832/.well-known/lmsp.json

# 2. List the local models
curl http://127.0.0.1:17832/lmsp/v1/models \
  -H "Authorization: Bearer $LMSP_TOKEN"

# 3. Generate a response
curl http://127.0.0.1:17832/lmsp/v1/responses \
  -H "Authorization: Bearer $LMSP_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"model":"qwen3:14b-q4_k_m","input":[{"type":"message","role":"user","content":[{"type":"input_text","text":"Hello"}]}]}'
```

## How LMSP relates to other protocols {#related}

| Protocol | What it covers | Relation to LMSP |
| --- | --- | --- |
| OpenAI API | Hosted models. The Responses API is its newest interface. | LMSP follows the Responses structure for its core interface, and a service offers an OpenAI-compatible interface next to it. |
| Ollama | A local runtime that already serves OpenAI-compatible endpoints. | It can sit behind an LMSP service as an adapter, and LMSP defines optional Ollama-compatible endpoints. |
| MCP | Connects agents to tools and context. | LMSP connects agents to models. Both prefer stateless discovery over mandatory sessions. |
| A2A | Collaboration between agents. | LMSP borrows service cards and explicit task states for its service description and its tasks. |

## Resources {#resources}

- The [specification, version 1.0 (draft)](https://madeforagent.com/lmsp/1.0.md).
- The OpenAPI contract, as [JSON](https://madeforagent.com/lmsp/1.0/openapi.json) or [YAML](https://madeforagent.com/lmsp/1.0/openapi.yaml).
- [llms.txt](https://madeforagent.com/llms.txt) and [llms-full.txt](https://madeforagent.com/llms-full.txt), for language models.
- Every page is available as Markdown. Replace the trailing slash of its address with `.md`, for example [`/lmsp/1.0/tasks.md`](https://madeforagent.com/lmsp/1.0/tasks.md).

## Frequently asked questions

### What is LMSP?

LMSP, the Local Model Service Protocol, is an open protocol for language-model services that run on a user's own device or local network. It defines how clients discover a service, list its models, request responses, stream output and run long tasks.

### Does LMSP replace the OpenAI API, Ollama or MCP?

No. LMSP builds on them. Its core interface follows the OpenAI Responses structure, a service can offer OpenAI-compatible and Ollama-compatible endpoints, and the protocol borrows stateless discovery from MCP and task states from A2A.

### Can existing OpenAI clients use an LMSP service?

Usually yes. They need a different base URL and the LMSP token as their API key. They do not find the service automatically, because discovery needs a client that supports LMSP.

### How does a client find a local LMSP service?

It tries three things in order. First an address entered by hand, then the conventional local address, where it requests /.well-known/lmsp.json, and finally optional mDNS and DNS-SD browsing for _lmsp._tcp.local. on the local network.

### Is a model service on localhost safe?

Not automatically, because web pages can try to reach local ports. LMSP services bind to loopback by default, require bearer tokens obtained by local pairing, check the Origin and Host headers, and require authentication in LAN mode.

### What is the status of the specification?

Version 1.0 is a first public draft and can still change incompatibly. The English text is normative, and translations are provided for convenience.
