LocalAI:在任何硬件上运行任何模型的开源 AI 引擎
英文标题:📦 mudler/LocalAI
LocalAI 是一个开源 AI 引擎,支持 LLM、视觉、语音、图像、视频等多种模态,无需 GPU 即可运行。其核心采用可组合架构,按需拉取 llama.cpp、vLLM、whisper.cpp 等后端,实现轻量部署。该工具提供与 OpenAI、Anthropic、ElevenLabs 等 API 的兼容性,内置智能体、多用户管理与隐私保护,对本地开发与隐私优先的场景极具价值。
893.3 KB
303.9 KB
51.9 KB
309.6 KB
112.9 KB
中文
Deutsch | Español | français | 日本語 | 한국어 | Português | Русский | 中文
LocalAI 是开源的 AI 引擎。在任何硬件上运行任何模型——LLM、视觉、语音、图像、视频。无需 GPU。
小而精的核心,而非捆绑包。 每个后端在各自的镜像中封装了同类最佳的引擎(llama.cpp、vLLM、whisper.cpp、stable-diffusion、MLX……),仅在模型需要时才拉取。你不用的东西绝不会被安装。
- 可组合式设计:后端彼此独立,按需拉取,因此你只安装模型所需的部分
- 开放且可扩展:加载任意模型,或基于开放接口用任何语言构建自己的后端
- 直接替换的 API 兼容:所有后端均兼容 OpenAI、Anthropic 和 ElevenLabs API
- 任意模型,任意模态:LLM、视觉、语音、图像和视频统一到一个 API 后
- 任意硬件:NVIDIA、AMD、Intel、Apple Silicon、Vulkan 或纯 CPU
- 多用户就绪:API 密钥认证、用户配额、基于角色的访问控制
- 内置 AI 智能体:具备工具使用、RAG、MCP 和技能的自主智能体
- 隐私优先:你的数据永远不会离开你的基础设施
由 Ettore Di Giacinto 创建,并由 LocalAI 团队维护。
微调与量化
注意: 该 DMG 未经 Apple 签名。安装后,请运行:
sudo xattr -d com.apple.quarantine /Applications/LocalAI.app。详见 #6268。
容器 (Docker, podman, ...)
之前运行过 LocalAI?使用
docker start -i local-ai重新启动现有容器。
docker run -ti --name local-ai -p 8080:8080 localai/localai:latest
# CUDA 13
docker run -ti --name local-ai -p 8080:8080 --gpus all localai/localai:latest-gpu-nvidia-cuda-13
# CUDA 12
docker run -ti --name local-ai -p 8080:8080 --gpus all localai/localai:latest-gpu-nvidia-cuda-12
# NVIDIA Jetson ARM64 (CUDA 12,适用于 AGX Orin 及类似设备)
docker run -ti --name local-ai -p 8080:8080 --gpus all localai/localai:latest-nvidia-l4t-arm64
# NVIDIA Jetson ARM64 (CUDA 13,适用于 DGX Spark)
docker run -ti --name local-ai -p 8080:8080 --gpus all localai/localai:latest-nvidia-l4t-arm64-cuda-13
docker run -ti --name local-ai -p 8080:8080 --device=/dev/kfd --device=/dev/dri --group-add=video localai/localai:latest-gpu-hipblas
docker run -ti --name local-ai -p 8080:8080 --device=/dev/dri/card1 --device=/dev/dri/renderD128 localai/localai:latest-gpu-intel
docker run -ti --name local-ai -p 8080:8080 localai/localai:latest-gpu-vulkan
# 从模型库中(使用 `local-ai models list` 或访问 https://models.localai.io 查看可用模型)
local-ai run llama-3.2-1b-instruct:q4_k_m
# 从 Huggingface
local-ai run huggingface://TheBloke/phi-2-GGUF/phi-2.Q8_0.gguf
# 从 Ollama OCI 注册表
local-ai run ollama://gemma:2b
# 从 YAML 配置
local-ai run https://gist.githubusercontent.com/.../phi-2.yaml
# 从标准 OCI 注册表(例如 Docker Hub)
local-ai run oci://localai/phi-2:latest
若要从终端测试正在运行的 LocalAI 服务器,可从另一个 shell 打开交互式聊天会话。在提示符中,/models 列出已安装的模型,/model <name> 在它们之间切换。
# 终端 1
local-ai run llama-3.2-1b-instruct:q4_k_m
# 终端 2
local-ai chat --model llama-3.2-1b-instruct:q4_k_m
自动后端检测:LocalAI 会自动检测你的 GPU 能力并下载合适的后端。高级选项请参考 GPU 加速。
更多细节请参阅 入门指南。
- 2026年6月:来自 LocalAI 团队的全新原生生物特征识别后端:voice-detect.cpp 用于说话人识别和语音分析(ECAPA-TDNN、WeSpeaker、ERes2Net、CAM++、wav2vec2 年龄/性别/情感)以及 face-detect.cpp 用于人脸检测、识别、人口统计和防伪(SCRFD/ArcFace、YuNet/SFace)。两者均为从零构建的 C++/ggml 引擎,推理时无需 Python 或 onnxruntime,自带独立 GGUF 权重,与参考实现位精确一致,并在 GPU cuDNN 上性能相当,替代了更重的 Python
insightface和speaker-recognition后端(PR #10441)。 - 2026年6月:新 实时语音助手演示(一个用于 Realtime API 的小型 Go 客户端,具有完整的对话语音循环和工具调用),以及 流式传输实时 LLM / TTS / 转录管道阶段 和 可配置 WebRTC ICE 候选项。
- 2026年6月:语音能力大幅提升:parakeet.cpp ASR 引擎获得 NeMo 一致的片段时间戳、多语言流式 Nemotron-3.5 模型、并发转录的动态批处理 和 CUDA 图;新的 CrispASR 后端 添加了多架构 ASR + TTS,且 60 个 Piper TTS 语音覆盖 42 种语言 登陆模型库(另含 按请求 TTS 指令和参数)。
- 2026年6月:新后端与模型:locate-anything.cpp 用于通过 ggml 进行开放词汇目标检测,Ideogram4 图像生成 加入 stablediffusion-ggml,llama.cpp 视频输入,以及 带有 MTP 推测解码对的 Gemma 4 QAT 系列。此外还有 交互式 CLI 聊天模式 和 智能体回复中的 RAG 来源引用。
- 2026年6月:分布式模式加固:前缀缓存感知路由、面向生产环境的请求路由器,具备自动调整大小的嵌入/重排序批次、ds4 层分割分布式推理、NATS JWT 认证 + TLS/mTLS 以及 可恢复的文件上传。
- 2026年5月:LocalAI 4.3.0 ——
llama.cpp默认开启提示缓存(重复的系统提示从分钟级降至秒级),无密钥 cosign 签名后端 OCI 镜像,按 API 密钥 + 按用户用量归因,分布式 v3 支持 按请求复本路由。发布说明 - 2026年5月:LocalAI 4.2.0 —— LocalAI 看到与听到:语音识别、人脸识别 + 防伪活体检测、说话人分离。外加 直接替换的 Ollama API、视频生成、重新设计并支持 i18n 与管理员可配置品牌的 UI,vLLM 功能与 llama.cpp 持平,以及 11 个新后端。发布说明
- 2026年4月:LocalAI 4.1.0 —— LocalAI 成为控制塔:分布式集群模式,具备 VRAM 感知智能路由 + 自动伸缩,支持 OIDC 和 API 密钥的多用户平台,带有预测分析的配额管理,UI 内使用 TRL 进行微调(自动导出为 GGUF),在线量化后端,可视化管道编辑器。发布说明
- 2026年3月:LocalAI 4.0.0 —— 原生智能体编排,配有新的 Agenthub 社区中心,完整 React UI 改写并支持画布模式,MCP 应用 + 客户端 及工具流式传输,WebRTC 实时音频,MLX 分布式。发布说明
- 2026年2月:支持工具调用的音频到音频 Realtime API,ACE-Step 1.5 支持
- 2026年1月:LocalAI 3.10.0 — Anthropic API 支持,Open Responses API,视频与图像生成 (LTX-2),统一 GPU 后端,工具流式传输,Moonshine,Pocket-TTS。发布说明
- 2025年12月:动态内存资源回收器,自动多 GPU 模型适配 (llama.cpp),Vibevoice 后端
- 2025年11月:通过 URL 导入模型,多聊天及历史记录
- 2025年10月:支持 模型上下文协议 (MCP),用于智能体能力
- 2025年9月:面向 macOS 和 Linux 的新启动器,扩展了对 Mac 和 Nvidia L4T 的后端支持,MLX-Audio,WAN 2.2
- 2025年8月:MLX、MLX-VLM、Diffusers、llama.cpp 现已在 Apple Silicon 上得到支持
- 2025年7月:所有后端已移出主二进制文件——轻量、模块化架构
更早的新闻和完整发布说明请参见 GitHub Releases 和 新闻页面。
支持的后端与加速
LocalAI 支持 60+ 后端,包括
English / 原文
Deutsch | Español | français | 日本語 | 한국어 | Português | Русский | 中文
LocalAI is the open-source AI engine. Run any model - LLMs, vision, voice, image, video - on any hardware. No GPU required.
A small core, not a bundle. Each backend wraps a best-in-class engine (llama.cpp, vLLM, whisper.cpp, stable-diffusion, MLX...) in its own image, pulled only when a model needs it. You install nothing you don't use.
- Composable by design : backends are separate and pulled on demand, so you install only what your model needs
- Open and extensible : load any model, or build your own backend in any language against an open interface
- Drop-in API compatibility : OpenAI, Anthropic, and ElevenLabs APIs across every backend
- Any model, any modality : LLMs, vision, voice, image, and video behind one API
- Any hardware : NVIDIA, AMD, Intel, Apple Silicon, Vulkan, or CPU-only
- Multi-user ready : API key auth, user quotas, role-based access
- Built-in AI agents : autonomous agents with tool use, RAG, MCP, and skills
- Privacy-first : your data never leaves your infrastructure
Created by Ettore Di Giacinto and maintained by the LocalAI team.
📖 Documentation | 💬 Discord | 💻 Quickstart | 🖼️ Models | ❓FAQ
model-fit-canvas-mode.mp4 Click to see more! usersquota-1775167475876.mp4 agents.mp4 usage.mp4
Fine-tuning and Quantization
quantize-fine-tune.mp4 talk.mp4
Note: The DMG is not signed by Apple. After installing, run:
sudo xattr -d com.apple.quarantine /Applications/LocalAI.app. See #6268 for details.
Containers (Docker, podman, ...)
Already ran LocalAI before? Use
docker start -i local-aito restart an existing container.
docker run -ti --name local-ai -p 8080:8080 localai/localai:latest
# CUDA 13
docker run -ti --name local-ai -p 8080:8080 --gpus all localai/localai:latest-gpu-nvidia-cuda-13
# CUDA 12
docker run -ti --name local-ai -p 8080:8080 --gpus all localai/localai:latest-gpu-nvidia-cuda-12
# NVIDIA Jetson ARM64 (CUDA 12, for AGX Orin and similar)
docker run -ti --name local-ai -p 8080:8080 --gpus all localai/localai:latest-nvidia-l4t-arm64
# NVIDIA Jetson ARM64 (CUDA 13, for DGX Spark)
docker run -ti --name local-ai -p 8080:8080 --gpus all localai/localai:latest-nvidia-l4t-arm64-cuda-13
docker run -ti --name local-ai -p 8080:8080 --device=/dev/kfd --device=/dev/dri --group-add=video localai/localai:latest-gpu-hipblas
docker run -ti --name local-ai -p 8080:8080 --device=/dev/dri/card1 --device=/dev/dri/renderD128 localai/localai:latest-gpu-intel
docker run -ti --name local-ai -p 8080:8080 localai/localai:latest-gpu-vulkan
# From the model gallery (see available models with `local-ai models list` or at https://models.localai.io)
local-ai run llama-3.2-1b-instruct:q4_k_m
# From Huggingface
local-ai run huggingface://TheBloke/phi-2-GGUF/phi-2.Q8_0.gguf
# From the Ollama OCI registry
local-ai run ollama://gemma:2b
# From a YAML config
local-ai run https://gist.githubusercontent.com/.../phi-2.yaml
# From a standard OCI registry (e.g., Docker Hub)
local-ai run oci://localai/phi-2:latest
To test a running LocalAI server from the terminal, open an interactive chat session from another shell. Inside the prompt, /models lists installed models and /model <name> switches between them.
# Terminal 1
local-ai run llama-3.2-1b-instruct:q4_k_m
# Terminal 2
local-ai chat --model llama-3.2-1b-instruct:q4_k_m
Automatic Backend Detection : LocalAI automatically detects your GPU capabilities and downloads the appropriate backend. For advanced options, see GPU Acceleration.
For more details, see the Getting Started guide.
- June 2026 : New native biometric backends from the LocalAI team: voice-detect.cpp for speaker recognition and voice analysis (ECAPA-TDNN, WeSpeaker, ERes2Net, CAM++, wav2vec2 age/gender/emotion) and face-detect.cpp for face detection, recognition, demographics and anti-spoofing (SCRFD/ArcFace, YuNet/SFace). Both are from-scratch C++/ggml engines with no Python or onnxruntime at inference, self-contained GGUF weights, bit-exact parity with the reference, and GPU cuDNN parity, replacing the heavier Python
insightfaceandspeaker-recognitionbackends (PR #10441). - June 2026 : New realtime voice assistant demo (a tiny Go client for the Realtime API with a full talk-back voice loop and tool calling), plus streaming of the realtime LLM / TTS / transcription pipeline stages and configurable WebRTC ICE candidates.
- June 2026 : Big speech push: the parakeet.cpp ASR engine gains NeMo-faithful segment timestamps, a multilingual streaming Nemotron-3.5 model, dynamic batching for concurrent transcription and CUDA graphs; the new CrispASR backend adds multi-architecture ASR + TTS, and 60 Piper TTS voices across 42 languages land in the gallery (plus per-request TTS instructions and params).
- June 2026 : New backends and models: locate-anything.cpp for open-vocabulary object detection via ggml, Ideogram4 image generation in stablediffusion-ggml, llama.cpp video input, and the Gemma 4 QAT family with MTP speculative-decoding pairs. Plus an interactive CLI chat mode and RAG source citations in agent responses.
- June 2026 : Distributed mode hardening: prefix-cache-aware routing, a production-ready request router with auto-sized embedding/rerank batches, ds4 layer-split distributed inference, NATS JWT auth + TLS/mTLS, and resumable file uploads.
- May 2026 : LocalAI 4.3.0 -
llama.cppprompt cache on by default (repeated system prompts collapse from minutes to seconds), keyless cosign signing of backend OCI images, per-API-key + per-user usage attribution, Distributed v3 with per-request replica routing. Release notes - May 2026 : LocalAI 4.2.0 - LocalAI sees and hears: voice recognition, face recognition + antispoofing liveness, speaker diarization. Plus drop-in Ollama API, video generation, redesigned UI with i18n + admin-configurable branding, vLLM at feature parity with llama.cpp, and 11 new backends. Release notes
- April 2026 : LocalAI 4.1.0 - LocalAI becomes a control tower: distributed cluster mode with VRAM-aware smart routing + autoscaling, multi-user platform with OIDC and API keys, per-user quotas with predictive analytics, in-UI fine-tuning with TRL (auto-export to GGUF), on-the-fly quantization backend, visual pipeline editor. Release notes
- March 2026 : LocalAI 4.0.0 - native agentic orchestration with the new Agenthub community hub, full React UI rewrite with Canvas mode, MCP Apps + client-side with tool streaming, WebRTC realtime audio, MLX-distributed. Release notes
- February 2026 : Realtime API for audio-to-audio with tool calling, ACE-Step 1.5 support
- January 2026 : LocalAI 3.10.0 — Anthropic API support, Open Responses API, video & image generation (LTX-2), unified GPU backends, tool streaming, Moonshine, Pocket-TTS. Release notes
- December 2025 : Dynamic Memory Resource reclaimer, Automatic multi-GPU model fitting (llama.cpp), Vibevoice backend
- November 2025 : Import models via URL, Multiple chats and history
- October 2025 : Model Context Protocol (MCP) support for agentic capabilities
- September 2025 : New Launcher for macOS and Linux, extended backend support for Mac and Nvidia L4T, MLX-Audio, WAN 2.2
- August 2025 : MLX, MLX-VLM, Diffusers, llama.cpp now supported on Apple Silicon
- July 2025 : All backends migrated outside the main binary — lightweight, modular architecture
For older news and full release notes, see GitHub Releases and the News page.
Supported Backends & Acceleration
LocalAI supports 60+ backends including llama.cpp, vLLM, SGLang, transformers, whisper.cpp, diffusers, MLX, MLX-VLM, and many more. Hardware acceleration is available for NVIDIA (CUDA 12/13), AMD (ROCm), Intel (oneAPI/SYCL), Apple Silicon (Metal), Vulkan , and NVIDIA Jetson (L4T). All backends can be installed on-the-fly from the Backend Gallery.
See the full Backend & Model Compatibility Table and GPU Acceleration guide.
Most backends wrap a best-in-class upstream engine. A handful of them are native C/C++/GGML engines (no Python at inference) developed and maintained by the LocalAI project itself:
| Backend | What it does |
|---|---|
| parakeet.cpp | C++/GGML port of NVIDIA NeMo Parakeet ASR (tdt/ctc/rnnt/hybrid), with cache-aware streaming transcription |
| ced.cpp | C++/GGML port of the CED audio-tagging models: sound-event classification (527-class AudioSet) over REST and the realtime API for live recognition |
| voxtral.c | Voxtral Realtime 4B speech-to-text in pure C |
| vibevoice.cpp | Native port of Microsoft VibeVoice for TTS (voice cloning) and long-form ASR with speaker diarization |
| rf-detr.cpp | Native RF-DETR object detection and instance segmentation |
| locate-anything.cpp | Open-vocabulary object detection and visual grounding (LocateAnything-3B) |
| depth-anything.cpp | Depth Anything 3 monocular metric depth + camera pose estimation |
| privacy-filter.cpp | Standalone GGML PII/NER token-classification engine powering LocalAI's PII redaction tier |
| LocalVQE | Joint acoustic echo cancellation, noise suppression, and dereverberation |
| local-store | Local-first vector database for embeddings (shipped in-tree) |
We also maintain apex-quant, a per-tensor, per-layer quantization recipe for Mixture-of-Experts models that exploits their structural sparsity to produce GGUFs matching or beating Q8_0 quality - and they run out of the box on stock llama.cpp.
LocalAI is maintained by a small team of humans, together with the wider community of contributors.
A huge thank you to everyone who contributes code, reviews PRs, files issues, and helps users in Discord — LocalAI is a community-driven project and wouldn't exist without you. See the full contributors list.
If you utilize this repository, data in a downstream project, please consider citing it with:
@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}},
Sponsors
Do you find LocalAI useful?
Support the project by becoming a backer or sponsor. Your logo will show up here with a link to your website.
A huge thank you to our generous sponsors who support this project covering CI expenses, and our Sponsor list:
Past sponsors
Individual sponsors
A special thanks to individual sponsors, a full list is on GitHub and buymeacoffee. Special shout out to drikster80 for being generous. Thank you everyone!
LocalAI is a community-driven project created by Ettore Di Giacinto and maintained by the LocalAI team.
MIT - Author Ettore Di Giacinto mudler@localai.io
LocalAI couldn't have been built without the help of great software already available from the community. Thank you!
This is a community project, a special thanks to our contributors!

