# LM Studio

来源: https://docs.aicentos.com/clients/lm-studio

Language: zh-CN

> LM Studio 是本地推理服务端而不是客户端 —— 说明它的正确角色与替代做法

LM Studio 常被当成「又一个聊天客户端」，其实方向是反的：它是**本地模型运行器**，对外暴露一个 OpenAI 兼容接口（默认 `http://localhost:1234/v1`），让别人来连它。它没有「填一个远程 Base URL」的入口，所以无法作为客户端接入 aicentos。

## 为什么不能直接接入

* 官方定位是 `Serve local models on OpenAI-like endpoints`，服务端角色，不是消费方。
* 桌面端、`lms` CLI 里都没有第三方 provider 的端点配置项。
* 它的云能力（LM Studio Secure Cloud、LM Link）是官方托管的算力通道，不接受自定义第三方端点。

## 需要填写的配置

| 字段       | 值                         |
| -------- | ------------------------- |
| API Key  | 控制台创建的 Key                |
| Base URL | `https://aicentos.com/v1` |
| 模型       | 控制台「模型广场」中的模型名            |

上表是 aicentos 侧的通用参数，供下面的替代方案使用。

## 替代方案

### 方案一：反过来用——让客户端连 LM Studio

如果你想跑本地模型，保持 LM Studio 当服务端，把 [Cherry Studio](https://docs.aicentos.com/clients/cherry-studio)、[Chatbox](https://docs.aicentos.com/clients/chatbox)、[Cline](https://docs.aicentos.com/clients/cline) 的 Base URL 填成 `http://localhost:1234/v1`。这条链路和 aicentos 无关，但它是 LM Studio 的正确用法。

### 方案二：要 aicentos 的模型，就换前端

[Cherry Studio](https://docs.aicentos.com/clients/cherry-studio)、[Chatbox](https://docs.aicentos.com/clients/chatbox)、[LobeChat](https://docs.aicentos.com/clients/lobechat) 都是桌面聊天客户端，支持多 provider 并存：一条填 aicentos，一条填本地 LM Studio，同一个界面里切换。

### 方案三：本地与云端混用

用 Cherry Studio 这类客户端同时挂两个 provider，简单任务走本地、复杂任务走 aicentos，按需切换即可。

## 测试

把 LM Studio 当服务端时，先 `lms server start`，再用 `curl http://localhost:1234/v1/models` 确认接口活着，然后在客户端里发一句提示词。

## 注意事项

* 别在 LM Studio 里找 Base URL 输入框，它只显示自己监听的地址。
* 本地模型的上下文与速度受本机显存限制，长上下文任务建议走 aicentos。
* 两个方向别混淆：**服务端填端口，客户端填端点**。

## 相关链接

* [LM Studio OpenAI 兼容接口](https://lmstudio.ai/docs/api/openai-api)
* [lms CLI](https://github.com/lmstudio-ai/lms)