[](https://github.com/go-skynet/LocalAI/actions/workflows/test.yml)[](https://github.com/go-skynet/LocalAI/actions/workflows/release.yaml)[](https://github.com/go-skynet/LocalAI/actions/workflows/image.yml)[](https://github.com/go-skynet/LocalAI/actions/workflows/bump_deps.yaml)[](https://artifacthub.io/packages/search?repo=localai)
**LocalAI** 是免费、开源的 OpenAI 替代品。LocalAI 作为一个兼容 OpenAI(Elevenlabs、Anthropic...)API 规范的本地 AI 推理 REST API 替代方案。它允许你在本地或本地消费级硬件上运行 LLMs、生成图像、音频(及更多功能),支持多种模型系列。无需 GPU。由 [Ettore Di Giacinto](https://github.com/mudler) 创建和维护。
## 本地技术栈家族
喜欢 LocalAI?LocalAI 是集成 AI 基础设施工具套件的一部分,你可能还会喜欢:
- **[LocalAGI](https://github.com/mudler/LocalAGI)** - 具备 OpenAI Responses API 兼容性和高级代理能力的 AI 代理编排平台
- **[LocalRecall](https://github.com/mudler/LocalRecall)** - MCP/REST API 知识库系统,为 AI 代理提供持久化记忆和存储
- 🆕 **[Cogito](https://github.com/mudler/cogito)** - 用于构建智能、协作代理软件和 LLM 驱动工作流的 Go 库,专注于提升小型开源语言模型的效果,并可扩展至任何 LLM。为 LocalAGI 和 LocalAI 的 MCP/代理能力提供支持
- 🆕 **[Wiz](https://github.com/mudler/wiz)** - 通过 Ctrl+Space 快捷键访问的终端 AI 代理。便携、本地 LLM 友好的 Shell 助手,支持 TUI/CLI 模式、带批准的工具执行、MCP 协议支持,以及多 Shell 兼容性(zsh、bash、fish)
- 🆕 **[SkillServer](https://github.com/mudler/skillserver)** - 通过 MCP 为 AI 代理提供简单、集中的技能数据库。将技能作为 Markdown 文件管理,支持 MCP 服务器集成、Web UI 编辑、Git 同步和全文搜索功能
## 截图 / 视频
### Youtube 视频
### 截图
| 对话界面 | 生成音频 |
| --- | --- |
|  |  |
| 模型概览 | 生成图像 |
| --- | --- |
|  |  |
| 聊天界面 | 首页 |
| --- | --- |
|  |  |
| 登录 | 集群 |
| --- | --- |
| |  |
## 💻 快速入门
### macOS 下载:
### 容器 (Docker, podman, ...)
#### 仅 CPU 镜像:
```
docker run -ti --name local-ai -p 8080:8080 localai/localai:latest
```
#### NVIDIA GPU 镜像:
```
# CUDA 13.0
docker run -ti --name local-ai -p 8080:8080 --gpus all localai/localai:latest-gpu-nvidia-cuda-13
# CUDA 12.0
docker run -ti --name local-ai -p 8080:8080 --gpus all localai/localai:latest-gpu-nvidia-cuda-12
# NVIDIA Jetson (L4T) ARM64
# CUDA 12 (适用于 Nvidia AGX Orin 及类似平台)
docker run -ti --name local-ai -p 8080:8080 --gpus all localai/localai:latest-nvidia-l4t-arm64
# CUDA 13 (适用于 Nvidia DGX Spark)
docker run -ti --name local-ai -p 8080:8080 --gpus all localai/localai:latest-nvidia-l4t-arm64-cuda-13
```
#### AMD GPU 镜像 (ROCm):
```
docker run -ti --name local-ai -p 8080:8080 --device=/dev/kfd --device=/dev/dri --group-add=video localai/localai:latest-gpu-hipblas
```
#### Intel GPU 镜像 (oneAPI):
```
docker run -ti --name local-ai -p 8080:8080 --device=/dev/dri/card1 --device=/dev/dri/renderD128 localai/localai:latest-gpu-intel
```
#### Vulkan GPU 镜像:
```
docker run -ti --name local-ai -p 8080:8080 localai/localai:latest-gpu-vulkan
```
#### AIO 镜像 (预下载模型):
```
# CPU 版本
docker run -ti --name local-ai -p 8080:8080 localai/localai:latest-aio-cpu
# NVIDIA CUDA 13 版本
docker run -ti --name local-ai -p 8080:8080 --gpus all localai/localai:latest-aio-gpu-nvidia-cuda-13
# NVIDIA CUDA 12 版本
docker run -ti --name local-ai -p 8080:8080 --gpus all localai/localai:latest-aio-gpu-nvidia-cuda-12
# Intel GPU 版本
docker run -ti --name local-ai -p 8080:8080 localai/localai:latest-aio-gpu-intel
# AMD GPU 版本
docker run -ti --name local-ai -p 8080:8080 --device=/dev/kfd --device=/dev/dri --group-add=video localai/localai:latest-aio-gpu-hipblas
```
有关 AIO 镜像和预下载模型的更多信息,请参阅 [容器文档](https://localai.io/basics/container/)。
加载模型:
```
# 从模型库 (可通过 `local-ai models list` 查看,在 WebUI 的 model 标签页,或访问 https://models.localai.io)
local-ai run llama-3.2-1b-instruct:q4_k_m
# 直接从 huggingface 使用 phi-2 模型启动 LocalAI
local-ai run huggingface://TheBloke/phi-2-GGUF/phi-2.Q8_0.gguf
# 从 Ollama OCI registry 安装并运行模型
local-ai run ollama://gemma:2b
# 从配置文件运行模型
local-ai run https://gist.githubusercontent.com/.../phi-2.yaml
# 从标准 OCI registry (例如 Docker Hub) 安装并运行模型
local-ai run oci://localai/phi-2:latest
```
更多信息,请参阅 [💻 入门指南](https://localai.io/basics/getting_started/index.html)。如果你对我们的路线图项目和未来增强功能感兴趣,可以查看 [此处标记为路线图的问题](https://github.com/mudler/LocalAI/issues?q=is%3Aissue+is%3Aopen+label%3Aroadmap)
## 📰 最新项目动态
- 2026 年 3 月:[代理管理](https://github.com/mudler/LocalAI/pull/8820),[新 React UI](https://github.com/mudler/LocalAI/pull/8772),[WebRTC](https://github.com/mudler/LocalAI/pull/8790),[通过 P2P 和 RDMA 进行 MLX 分布式](https://github.com/mudler/LocalAI/pull/8801)
- 2026 年 2 月:[支持工具调用的音频到音频实时 API](https://github.com/mudler/LocalAI/pull/6245),[ACE-Step 1.5 支持](https://github.com/mudler/LocalAI/pull/8396)
- 2026 年 1 月:**LocalAI 3.10.0** - 重大版本更新,包含 Anthropic API 支持、用于有状态代理的 Open Responses API、视频和图像生成套件 (LTX-2)、统一 GPU 后端、工具流和 XML 解析、系统感知后端库、仅限 AVX 的 CPU 和 AMD VRAM 报告的崩溃修复、请求追踪,以及新后端:**Moonshine**(超快转录)、**Pocket-TTS**(轻量级 TTS)。现提供 Vulkan arm64 构建。[发布说明](https://github.com/mudler/LocalAI/releases/tag/v3.10.0)。
- 2025 年 12 月:[动态内存资源回收器](https://github.com/mudler/LocalAI/pull/7583),[模型自动适配多 GPU (llama.cpp)](https://github.com/mudler/LocalAI/pull/7584),[新增 Vibevoice 后端](https://github.com/mudler/LocalAI/pull/7494)
- 2025 年 11 月:用户体验大幅改进。其中包括:[通过 URL 导入模型](https://github.com/mudler/LocalAI/pull/7245) 和 [多会话及历史记录](https://github.com/mudler/LocalAI/pull/7325)
- 2025 年 10 月:🔌 新增 [模型上下文协议 (MCP)](https://localai.io/docs/features/mcp/) 支持,用于具备外部工具的代理能力
- 2025 年 9 月:面向 MacOS 和 Linux 的新启动器应用程序,扩展了对 Mac 和 Nvidia L4T 设备的许多后端支持。模型:新增 MLX-Audio、WAN 2.2。WebUI 改进,基于 Python 的后端现附带便携式 Python 环境。
- 2025 年 8 月:MLX、MLX-VLM、Diffusers 和 llama.cpp 现支持 Mac M1/M2/M3+ 芯片(在 gallery 中使用 `development` 后缀):https://github.com/mudler/LocalAI/pull/6049 https://github.com/mudler/LocalAI/pull/6119 https://github.com/mudler/LocalAI/pull/6121 https://github.com/mudler/LocalAI/pull/6060
- 2025 年 7/8 月:🔍 API 新增 [对象检测](https://localai.io/features/object-detection/) 功能,特色是 [rf-detr](https://github.com/roboflow/rf-detr)
- 2025 年 7 月:所有后端已迁移至主二进制文件之外。LocalAI 现在更轻量、更小,并自动下载运行模型所需的后端。[阅读发布说明](https://github.com/mudler/LocalAI/releases/tag/v3.2.0)
- 2025 年 6 月:已新增 [后端管理](https://github.com/mudler/LocalAI/pull/5607)。注意:extras 镜像将在下个版本中弃用!请阅读 [后端管理 PR](https://github.com/mudler/LocalAI/pull/5607)。
- 2025 年 5 月:llama.cpp 后端中的 [音频输入](https://github.com/mudler/LocalAI/pull/5466) 和 [重排序](https://github.com/mudler/LocalAI/pull/5396),[实时 API](https://github.com/mudler/LocalAI/pull/5392),支持 Gemma、SmollVLM 和更多多模态模型(可在 gallery 中获取)。
- 2025 年 5 月:重要提示:镜像名称变更 [查看发布](https://github.com/mudler/LocalAI/releases/tag/v2.29.0)
- 2025 年 4 月:品牌重塑,WebUI 增强
- 2025 年 4 月:[LocalAGI](https://github.com/mudler/LocalAGI) 和 [LocalRecall](https://github.com/mudler/LocalRecall) 加入 LocalAI 家族技术栈。
- 2025 年 4 月:WebUI 重构,AIO 镜像更新
- 2025 年 2 月:后端清理,破坏性更改,新后端(kokoro, OutelTTS, faster-whisper),Nvidia L4T 镜像
- 2025 年 1 月:LocalAI 模型发布:https://huggingface.co/mudler/LocalAI-functioncall-phi-4-v0.3,diffusers 中的 SANA 支持:https://github.com/mudler/LocalAI/pull/4603
- 2024 年 12 月:新增 stablediffusion.cpp 后端(ggml)( https://github.com/mudler/LocalAI/pull/4289 )
- 2024 年 11 月:新增 Bark.cpp 后端 ( https://github.com/mudler/LocalAI/pull/4287 )
- 2024 年 11 月:API 新增语音活动检测模型(**VAD**):https://github.com/mudler/LocalAI/pull/4204
- 2024 年 10 月:示例已移至 [LocalAI-examples](https://github.com/mudler/LocalAI-examples)
- 2024 年 8 月: 🆕 FLUX-1,[P2P 浏览器](https://explorer.localai.io)
- 2024 年 7 月:🔥🔥 🆕 P2P 仪表板,LocalAI 联邦模式和 AI 集群:https://github.com/mudler/LocalAI/pull/2723。P2P 全球社区资源池:https://github.com/mudler/LocalAI/issues/3113
- 2024 年 5 月:🔥🔥 去中心化 P2P llama.cpp: https://github.com/mudler/LocalAI/pull/2343 (点对点 llama.cpp!) 👉 文档 https://localai.io/features/distribute/
- 2024 年 5 月:🔥🔥 分布式推理:https://github.com/mudler/LocalAI/pull/2324
- 2024 年 4 月:重排序 API:https://github.com/mudler/LocalAI/pull/2121
路线图项目:[问题列表](https://github.com/mudler/LocalAI/issues?q=is%3Aissue+is%3Aopen+label%3Aroadmap)
## 🚀 [功能特性](https://localai.io/features/)
- 🧩 [后端库](https://localai.io/backends/):由 OCI 镜像驱动,动态安装/移除后端 —— 完全可定制且由 API 驱动。
- 📖 [使用 GPTs 进行文本生成](https://localai.io/features/text-generation/)(`llama.cpp`、`transformers`、`vllm` ... [:book: 以及更多](https://localai.io/model-compatibility/index.html#model-compatibility-table))
- 🗣 [文本转语音](https://localai.io/features/text-to-audio/)
- 🔈 [语音转文本](https://localai.io/features/audio-to-text/)
- 🎨 [图像生成](https://localai.io/features/image-generation)
- 🔥 [类 OpenAI 工具 API](https://localai.io/features/openai-functions/)
- ⚡ [实时 API](https://localai.io/features/openai-realtime/)(语音到语音)
- 🧠 [用于向量数据库的 Embedding 生成](https://localai.io/features/embeddings/)
- ✍️ [受限语法](https://localai.io/features/constrained_grammars/)
- 🖼️ [直接从 Huggingface 下载模型](https://localai.io/models/)
- 🥽 [视觉 API](https://localai.io/features/gpt-vision/)
- 🔍 [对象检测](https://localai.io/features/object-detection/)
- 📈 [重排序 API](https://localai.io/features/reranker/)
- 🆕🖧 [P2P 推理](https://localai.io/features/distribute/)
- 🆕🔌 [模型上下文协议 (MCP)](https://localai.io/docs/features/mcp/) - 具备外部工具的代理能力及 [LocalAGI 的代理能力](https://github.com/mudler/LocalAGI)
- 🆕🤖 [内置代理](https://localai.io/features/agents/) - 具备工具使用、知识库 (RAG)、技能、SSE 流、导入/导出功能的自主 AI 代理,以及 [代理中心](https://agenthub.localai.io) —— 由 [LocalAGI](_URL_61/>) 提供支持
- 🔊 语音活动检测(支持 Silero-VAD)
- 🌍 集成 WebUI!
## 🧩 支持的后端与加速
LocalAI 支持广泛的 AI 后端及多种加速选项:
### 文本生成与语言模型
| 后端 | 描述 | 加速支持 |
|---------|-------------|---------------------|
| **llama.cpp** | C/C++ 编写的 LLM 推理 | CUDA 12/13, ROCm, Intel SYCL, Vulkan, Metal, CPU |
| **vLLM** | 使用 PagedAttention 的快速 LLM 推理 | CUDA 12/13, ROCm, Intel |
| **transformers** | HuggingFace transformers 框架 | CUDA 12/13, ROCm, Intel, CPU |
| **MLX** | Apple Silicon LLM 推理 | Metal (M1/M2/M3+) |
| **MLX-VLM** | Apple Silicon 视觉-语言模型 | Metal (M1/M2/M3+) |
### 音频与语音处理
| 后端 | 描述 | 加速支持 |
|---------|-------------|---------------------|
| **whisper.cpp** | C/C++ 编写的 OpenAI Whisper | CUDA 12/13, ROCm, Intel SYCL, Vulkan, CPU |
| **faster-whisper** | 使用 CTranslate2 的快速 Whisper | CUDA 12/13, ROCm, Intel, CPU |
| **moonshine** | 适用于低端设备的超快转录引擎 | CUDA 12/13, Metal, CPU |
| **coqui** | 支持 1100+ 种语言的高级 TTS | CUDA 12/13, ROCm, Intel, CPU |
| **kokoro** | 轻量级 TTS 模型 | CUDA 12/13, ROCm, Intel, CPU |
| **chatterbox** | 生产级 TTS | CUDA 12/13, CPU |
| **piper** | 快速神经 TTS 系统 | CPU |
| **kitten-tts** | Kitten TTS 模型 | CPU |
| **silero-vad** | 语音活动检测 | CPU |
| **neutts** | 支持声音克隆的文本转语音 | CUDA 12/13, ROCm, CPU |
| **vibevoice** | 支持声音克隆的实时 TTS | CUDA 12/13, ROCm, Intel, CPU |
| **pocket-tts** | 轻量级基于 CPU 的 TTS | CUDA 12/13, ROCm, Intel, CPU |
| **qwen-tts** | 支持自定义语音、语音设计和声音克隆的高质量 TTS | CUDA 12/13, ROCm, Intel, CPU |
| **ace-step** | 从文本描述、歌词或音频样本生成音乐 | CUDA 12/13, ROCm, Intel, Metal, CPU |
### 图像与视频生成
| 后端 | 描述 | 加速支持 |
|---------|-------------|---------------------|
| **stablediffusion.cpp** | C/C++ 编写的 Stable Diffusion | CUDA 12/13, Intel SYCL, Vulkan, CPU |
| **diffusers** | HuggingFace 扩散模型 | CUDA 12/13, ROCm, Intel, Metal, CPU |
### 专项 AI 任务
| 后端 | 描述 | 加速支持 |
|---------|-------------|---------------------|
| **rfdetr** | 实时对象检测 | CUDA 12/13, Intel, CPU |
| **rerankers** | 文档重排序 API | CUDA 12/13, ROCm, Intel, CPU |
| **local-store** | 向量数据库 | CPU |
| **huggingface** | HuggingFace API 集成 | 基于 API |
### 硬件加速矩阵
| 加速类型 | 支持的后端 | 硬件支持 |
|-------------------|-------------------|------------------|
| **NVIDIA CUDA 12** | 所有兼容 CUDA 的后端 | Nvidia 硬件 |
| **NVIDIA CUDA 13** | 所有兼容 CUDA 的后端 | Nvidia 硬件 |
| **AMD ROCm** | llama.cpp, whisper, vllm, transformers, diffusers, rerankers, coqui, kokoro, neutts, vibevoice, pocket-tts, qwen-tts, ace-step | AMD 显卡 |
| **Intel oneAPI** | llama.cpp, whisper, stablediffusion, vllm, transformers, diffusers, rfdetr, rerankers, coqui, kokoro, vibevoice, pocket-tts, qwen-tts, ace-step | Intel Arc, Intel 集成显卡 |
| **Apple Metal** | llama.cpp, whisper, diffusers, MLX, MLX-VLM, moonshine, ace-step | Apple M1/M2/M3+ |
| **Vulkan** | llama.cpp, whisper, stablediffusion | 跨平台 GPU |
| **NVIDIA Jetson (CUDA 12)** | llama.cpp, whisper, stablediffusion, diffusers, rfdetr, ace-step | ARM64 嵌入式 AI (AGX Orin 等) |
| **NVIDIA Jetson (CUDA 13)** | llama.cpp, whisper, stablediffusion, diffusers, rfdetr | ARM64 嵌入式 AI (DGX Spark) |
| **CPU 优化** | 所有后端 | AVX/AVX2/AVX512,支持量化 |
### 🔗 社区与集成
构建和部署自定义容器:
- https://github.com/sozercan/aikit
WebUIs:
- https://github.com/Jirubizu/localai-admin
- https://github.com/go-skynet/LocalAI-frontend
- QA-Pilot(一个利用 LocalAI LLMs 快速理解和导航 GitHub 代码仓库的交互式聊天项目) https://github.com/reid41/QA-Pilot
代理库:
- https://github.com/mudler/cogito
MCPs:
- https://github.com/mudler/MCPs
操作系统助手:
- https://github.com/mudler/Keygeist - Keygeist 是一个 AI 驱动的键盘操作器,它监听组合键并使用 AI 生成的文本直接输入到你的 Linux 设备中。
模型库
- https://github.com/go-skynet/model-gallery
语音:
- https://github.com/richiejp/VoxInput
其他:
- Helm chart https://github.com/go-skynet/helm-charts
- VSCode 扩展 https://github.com/badgooooor/localai-vscode-plugin
- Langchain:https://python.langchain.com/docs/integrations/providers/localai/
- 终端实用工具 https://github.com/djcopley/ShellOracle
- 本地智能助手 https://github.com/mudler/LocalAGI
- Home Assistant https://github.com/drndos/hass-openai-custom-conversation / https://github.com/valentinfrlch/ha-llmvision / https://github.com/loryanstrant/HA-LocalAI-Monitor
- Discord 机器人 https://github.com/mudler/LocalAGI/tree/main/examples/discord
- Slack 机器人 https://github.com/mudler/LocalAGI/tree/main/examples/slack
- Shell-Pilot(通过纯 Shell 脚本在 Linux 或 MacOS 系统上使用 LocalAI 模型与 LLM 交互) https://github.com/reid41/shell-pilot
- Telegram 机器人 https://github.com/mudler/LocalAI/tree/master/examples/telegram-bot
- 另一个 Telegram 机器人 https://github.com/JackBekket/Hellper
- 自动文档生成 https://github.com/JackBekket/Reflexia
- 回答问题的 Github 机器人,以代码和文档为上下文 https://github.com/JackBekket/GitHelper
- Github Actions:https://github.com/marketplace/actions/start-localai
- 示例:https://github.com/mudler/LocalAI/tree/master/examples/
### 🔗 资源
- [LLM 微调指南](https://localai.io/docs/advanced/fine-tuning/)
- [如何在本地构建](https://localai.io/basics/build/index.html)
- [如何在 Kubernetes 中安装](https://localai.io/basics/getting_started/index.html#run-localai-in-kubernetes)
- [集成 LocalAI 的项目](https://localai.io/docs/integrations/)
- [操作指南部分](https://io.midori-ai.xyz/howtos/)(由社区精选)
## :book: 🎥 [媒体、博客、社交](https://localai.io/basics/news/#media-blogs-social)
- 🆕 [LocalAI 自主开发团队博客文章](https://mudler.pm/posts/2026/02/28/a-call-to-open-source-maintainers-stop-babysitting-ai-how-i-built-a-100-local-autonomous-dev-team-to-maintain-localai-and-why-you-should-too/)
- [使用 LocalAI 运行 Visual studio code (SUSE)](https://www.suse.com/c/running-ai-locally/)
- 🆕 [在 Jetson Nano Devkit 上运行 LocalAI](https://mudler.pm/posts/local-ai-jetson-nano-devkit/)
- [使用 Pulumi 在 AWS EKS 上运行 LocalAI](https://www.pulumi.com/blog/low-code-llm-apps-with-local-ai-flowise-and-pulumi/)
- [在 AWS 上运行 LocalAI](https://staleks.hashnode.dev/installing-localai-on-aws-ec2-instance)
- [为团队和 OSS 项目创建回答文档的 Slack 机器人](https://mudler.pm/posts/smart-slackbot-for-teams/)
- [LocalAI 遇见 k8sgpt](https://www.youtube.com/watch?v=PKrDNuJ_dfE)
- [使用 LangChain、LocalAI、Chroma 和 GPT4All 在本地进行文档问答](https://mudler.pm/posts/localai-question-answering/)
- [使用 LocalAI 的 k8sgpt 教程](https://medium.com/@tyler_97636/k8sgpt-localai-unlock-kubernetes-superpowers-for-free-584790de9b65)
## 🤖 自主开发团队
LocalAI 现在由一个由 AI Scrum Master 领导的全自主 AI 代理团队协助维护(处理小任务!)这项实验展示了开源项目如何利用 AI 代理实现可持续的长期维护。
- **📊 实时报告**:[自动生成的报告](http://reports.localai.io)
- **📋 项目看板**:[代理任务跟踪](https://github.com/users/mudler/projects/6)
- **📝 博客文章**:[了解自主开发团队实验](https://mudler.pm/posts/2026/02/28/a-call-to-open-source-maintainers-stop-babysitting-ai-how-i-built-a-100-local-autonomous-dev-team-to-maintain-localai-and-why-you-should-too/)
## 引用
如果你在下游项目中使用了本仓库或数据,请考虑引用它:
```
@misc{localai,
author = {Ettore Di Giacinto},
title = {LocalAI: The free, Open source OpenAI alternative},
year = {2023},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/go-skynet/LocalAI}},
```
## 📖 许可证
LocalAI 是一个由 [Ettore Di Giacinto](https://github.com/mudler/) 创建的社区驱动项目。
MIT - 作者 Ettore Di Giacinto
## 🙇 致谢
如果没有社区已有的优秀软件的帮助,LocalAI 就无法构建。谢谢你们!
- [llama.cpp](https://github.com/ggerganov/llama.cpp)
- https://github.com/tatsu-lab/stanford_alpaca
- https://github.com/cornelk/llama-go 提供的初步想法
- https://github.com/antimatter15/alpaca.cpp
- https://github.com/EdVince/Stable-Diffusion-NCNN
- https://github.com/ggerganov/whisper.cpp
- https://github.com/rhasspy/piper
## 🤗 贡献者
这是一个社区项目,特别感谢我们的贡献者! 🤗