# LocalAI

框架 · https://godooo.ai/zh/framework/localai

> LocalAI 是开源 AI 开发框架，2023 年推出，面向开发者、企业。

自托管的推理引擎，用兼容 OpenAI 的 API 提供大模型、语音、图像和视频模型。

主打：大模型 API、本地运行模型、模型推理部署。开源，可以免费使用。使用方式：自部署、本地离线运行、API、命令行。

## 速览

- **类别:** [框架](https://godooo.ai/zh/browse#framework)
- **推出于:** 2023
- **所属星系:** [模型与 API](https://godooo.ai/zh/galaxy/builders)
- **是否开源:** 是 · MIT
- **源代码:** [github.com/mudler/LocalAI](https://github.com/mudler/LocalAI)
- **GitHub 星标:** 49,253
- **使用方式:** 可自部署 · 可离线本地运行 · API · 命令行
- **适合谁:** 开发者 · 企业
- **支持的协议:** [OpenAI-compatible API](https://godooo.ai/zh/protocol/openai-compatible-api)
- **官网:** [localai.io](https://localai.io)

## 能做什么

- **[大模型 API](https://godooo.ai/zh/capability/llm-api)** — 主打, _由机器提出，尚待校准_. “Drop-in API compatibility : OpenAI, Anthropic, and ElevenLabs APIs across every backend” (摘自 [github.com](https://github.com/mudler/LocalAI)，2026-09-24)
- **[本地运行模型](https://godooo.ai/zh/capability/local-inference)** — 主打, _由机器提出，尚待校准_. “Run any model, LLMs, vision, voice, image and video, on any hardware. No GPU required.” (摘自 [localai.io](https://localai.io/)，2026-09-24)
- **[模型推理部署](https://godooo.ai/zh/capability/model-serving)** — 主打, _由机器提出，尚待校准_. “One binary with an OpenAI-compatible API in front of it.” (摘自 [localai.io](https://localai.io/)，2026-09-24)
- **[向量嵌入](https://godooo.ai/zh/capability/embeddings)** — 支持, _由机器提出，尚待校准_. “Embeddings generation” (摘自 [github.com](https://github.com/mudler/LocalAI)，2026-09-24)
- **[图像理解](https://godooo.ai/zh/capability/image-understanding)** — 支持, _由机器提出，尚待校准_. “See things Ask for "the red mug on the left" in plain language and get back coordinates, not a caption.” (摘自 [localai.io](https://localai.io/)，2026-09-24)
- **[文生图](https://godooo.ai/zh/capability/text-to-image)** — 支持, _由机器提出，尚待校准_. “Create Images, video, music and sound diffusers · ace-step” (摘自 [localai.io](https://localai.io/)，2026-09-24)
- **[语音合成](https://godooo.ai/zh/capability/text-to-speech)** — 支持, _由机器提出，尚待校准_. “Speak Speech synthesis and voice cloning moss-tts · piper” (摘自 [localai.io](https://localai.io/)，2026-09-24)
- **[语音转写](https://godooo.ai/zh/capability/speech-to-text)** — 支持, _由机器提出，尚待校准_. “Hear words Live transcription with speaker labels and timestamps, fast enough to keep up with a meeting while it is still happening.” (摘自 [localai.io](https://localai.io/)，2026-09-24)

## 平替与同类

- **[Ollama](https://godooo.ai/zh/product/ollama)** (开源免费): 同样能做：本地运行模型、大模型 API、模型推理部署
- **[exo](https://godooo.ai/zh/framework/exo)** (开源免费): 同样能做：本地运行模型、模型推理部署、大模型 API
- **[MLC LLM](https://godooo.ai/zh/framework/mlc-llm)** (开源免费): 同样能做：本地运行模型、模型推理部署、大模型 API
- **[Mistral](https://godooo.ai/zh/model/mistral)** (开源免费): 同样能做：大模型 API、向量嵌入、本地运行模型
- **[WebLLM](https://godooo.ai/zh/framework/webllm)** (开源免费): 同样能做：大模型 API、本地运行模型
- **[LMDeploy](https://godooo.ai/zh/framework/lmdeploy)** (开源免费): 同样能做：大模型 API、模型推理部署
- **[Qwen](https://godooo.ai/zh/model/qwen)** (开源免费): 同样能做：大模型 API、图像理解、本地运行模型；不用写代码
- **[LLM](https://godooo.ai/zh/cli/llm)** (开源免费): 同样能做：大模型 API、向量嵌入、本地运行模型
- **[Replicate](https://godooo.ai/zh/product/replicate)** (付费): 同样能做：大模型 API、文生图、模型推理部署
- **[TextGen](https://godooo.ai/zh/product/textgen)** (开源免费): 同样能做：本地运行模型、图像理解、大模型 API；不用写代码
- **[Gemini](https://godooo.ai/zh/model/gemini)**: 同样能做：图像理解、大模型 API；不用写代码
- **[GPT](https://godooo.ai/zh/model/gpt)**: 同样能做：大模型 API、图像理解、文生图；不用写代码

## 关系

- **基于…构建:** [llama.cpp](https://godooo.ai/zh/framework/llama-cpp)

## 常见问题

### LocalAI 是什么？

LocalAI 是开源 AI 开发框架，2023 年推出，面向开发者、企业。自托管的推理引擎，用兼容 OpenAI 的 API 提供大模型、语音、图像和视频模型。

### LocalAI 免费吗？

免费。LocalAI 是开源软件（MIT）。

### LocalAI 开源吗？

开源，许可证是 MIT。源代码在 https://github.com/mudler/LocalAI。

### LocalAI 能本地运行吗？

能，可以在自己的电脑上离线运行。也可以部署在自己的服务器上。

### LocalAI 能做什么？

主打：大模型 API、本地运行模型、模型推理部署。也能做：向量嵌入、图像理解、文生图、语音合成、语音转写。

### LocalAI 有哪些开源替代品？

开源的有：Ollama、exo、MLC LLM、Mistral、WebLLM、LMDeploy、Qwen、LLM。其他：Replicate、Gemini、GPT。

## 来源

- [github.com](https://github.com/mudler/LocalAI) — 核实于 2026-09-24
- [localai.io](https://localai.io/) — 核实于 2026-09-24

---

最后更新 2026-09-24 · 来源核实于 2026-09-24 · 这是 https://godooo.ai/zh/framework/localai 的 Markdown 版本。本站每个页面都有：在地址后面加 .md。
