Agent 开发框架

PrivateGPT|本地模型私有 AI 应用 API 接入层

PrivateGPT

PrivateGPT 是一个开源 API 层,把本地 OpenAI 兼容推理服务封装为面向私有 AI 应用的 Claude 风格接口,提供检索、工具、MCP、数据库等后端能力。

获取与使用

需要部署

按官方资料自行安装或部署

使用难度待核验
国内可用性待核验

2026-11-09 更新 · 本站尚未实测

项目介绍

Agent 开发框架 · 2026-11-09 更新 · 本站尚未实测

PrivateGPT 是 Zylon 维护的开源项目,定位为「把本地模型变成生产级 AI 应用的开源 API 层」。README 明确指出:运行模型只是第一步,构建有用的 AI 应用还需要更高层的积木;PrivateGPT 按 Claude API 模型提供这层能力,让开发者不必从零重建后端基础组件,也不必依赖云 API。

需要先厘清一个常见误解:PrivateGPT 本身不运行模型。它通过 OPENAI_API_BASE 连接任何实现 /v1/chat/completions 与 /v1/models 的 OpenAI 兼容推理服务(如 Ollama、llama.cpp、vLLM 等)。文档同时说明,项目自带的 /ui 工作台只是演示与测试用途,API 才是实际产品。

项目历史:2023 年以「离线与文档对话」概念走红,后重构为 PrivateGPT 1.0 API 层。README 说明其由 Zylon 团队维护,Zylon 是在其之上叠加推理编排、Kubernetes 部署、权限、审计、连接器等能力的企业平台。

核心能力

点击能力名称查看输入、输出和原文依据。

按 README 的能力表,PrivateGPT 提供:

  • 标准消息 API:流式、异步、token 计数;
  • 文件与工件摄取,PDF/文档解析;
  • 带引用的检索与 agentic RAG;
  • 内置工具(网页搜索、网页抓取、代码执行),对标 Claude API;
  • 自定义工具与 MCP 连接器,支持远程 MCP 服务器;
  • 数据库结构化访问与 CSV/表格分析(内置);
  • Embeddings 与编排;
  • 结构化输出(依赖推理端)、视觉(依赖模型)、扩展思考。

README 同时列出当前限制:Prompt caching 不支持;OAuth/组织管理不支持;Skills 仅基础支持(⚙️ 部分/进行中)。README 鼓励社区在这些区域贡献。

实际应用场景

适用场景

  • 在完全本地/内网推理服务之上构建私有 RAG 问答与文档分析应用;
  • 为终端编码助手(如 Claude Code、OpenCode)或其他兼容本地 OpenAI 提供方的工具提供本地后端;
  • 为 n8n、Cline、VS Code 等工作流或开发工具接入私有模型;
  • 通过 MCP 连接器与自定义工具扩展智能体能力;
  • 对数据库、CSV 做结构化问答与分析。

README 将这些集成列为「原生可用」或「与本地 OpenAI 兼容提供方兼容」,但具体配置步骤需查阅各自集成文档。

安装与接入

README 给出的前置条件是:需要一个正在运行的 OpenAI 兼容 LLM 服务器,Ollama 是最容易的起点。安装命令按平台区分(以下为原文给出的命令,未做拼接改写):

macOS:

brew tap zylon-ai/tap
brew install private-gpt

Linux:

curl -LsSf https://astral.sh/uv/install.sh | sh

uv tool install --python 3.11 \
  --find-links https://wheels.privategpt.dev/packages/ \
  "private-gpt[core]"

Windows(PowerShell):

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

uv tool install --python 3.11 `
  --find-links https://wheels.privategpt.dev/packages/ `
  "private-gpt[core]"

随后按 README 用 Ollama 拉取模型并启动服务,再以环境变量 OPENAI_API_BASE 与 OPENAI_EMBEDDING_API_BASE 指向推理服务并执行 private-gpt serve,最后访问 http://localhost:8080/ui。API 位于 http://localhost:8080,遵循 Anthropic API 规范。Docker 与完整安装选项请参阅官方 Quickstart。

使用条件与限制

是否需要部署
需自行准备运行环境,具体要求见正文
是否需要注册
账号和认证要求见正文;未明确说明的项目仍待核验
是否需要 API Key
待核验
费用与额度
费用边界见正文,项目许可不代表模型或托管服务免费
所需权限
待核验
许可证与服务条款
待核验

权限费用与限制

  • 模型与推理成本:PrivateGPT 不自带模型;模型由外部推理服务提供,其资源消耗、许可与费用取决于所选模型和服务,需自行核验。
  • API 鉴权:README 能力表标注支持 token 鉴权;OAuth/组织管理不支持。具体鉴权配置细节需以官方 API 文档为准。
  • 数据边界:项目定位为私有/本地部署,但项目本身不承诺任何安全合规认证;README 提到 Zylon 版本具备 SIEM 审计、LDAP/RBAC 等企业能力,这些属于商业平台而非开源仓库。
  • 收费边界:README 未给出 PrivateGPT 开源部分的价格,也未列出 Zylon 商业版价格;任何费用需向官方核验。开源不等于模型、云服务或企业功能免费。
  • 功能差异:README 明确标注 OAuth、Prompt caching 不支持,Skills 为部分支持,结构化输出与视觉依赖具体推理模型。

国内使用情况

网友核验 用户经验分享

与站长实测独立,不代表官方认证或本站已实测。

我要核验
0 位参与者0 份有效分项记录

最近核验:暂无有效核验。参与人数按当前项目有效身份去重;不同核验项分别统计,不合并成用户总结果。仅统计审核通过且未过期的记录。

分项统计、有效期与样本量
核验项目有效人数成功 / 部分 / 失败 / 无法判断成功率最近核验 / 有效期
官方网站访问00 / 0 / 0 / 0样本不足暂无 / 7 天
GitHub 仓库访问00 / 0 / 0 / 0样本不足暂无 / 7 天
安装与运行00 / 0 / 0 / 0样本不足暂无 / 30 天
官方服务国内连接 / MCP 连接00 / 0 / 0 / 0样本不足暂无 / 30 天
国内网络情况00 / 0 / 0 / 0样本不足暂无 / 7 天
国内模型兼容性00 / 0 / 0 / 0样本不足暂无 / 30 天
自定义 API00 / 0 / 0 / 0样本不足暂无 / 30 天
海外服务依赖
00 / 0 / 0 / 0样本不足暂无 / 30 天
海外账号要求
00 / 0 / 0 / 0样本不足暂无 / 30 天
中文界面
00 / 0 / 0 / 0样本不足暂无 / 30 天
客户端兼容性00 / 0 / 0 / 0样本不足暂无 / 30 天
账号及费用信息
00 / 0 / 0 / 0样本不足暂无 / 30 天

成功率 = 成功 ÷(成功 + 部分成功 + 失败);无法判断不计入分母。至少 5 份可判断结果才显示成功率。账号、费用、海外依赖与语言等事实项,成功表示核查结论与资料吻合,具体观察另行统计;不表示免费或没有海外依赖。不同网络、客户端和版本的结果不能直接等同。

最近有效核验

暂无审核通过且未过期的网友核验。欢迎提交真实使用记录。

查看全部有效核验 →

国内实测状态:国内可用性待核验。协议兼容和官方资料说明不等于国内网络可用。

官方网站访问
尚未实测 待核验
GitHub 仓库访问
尚未实测 待核验
官方服务国内连接
尚未实测 待核验
国内网络情况
尚未实测 待核验
国内模型兼容性
尚未实测 待核验
自定义 API
尚未实测 待核验
海外服务依赖
尚未实测 待核验
海外账号要求
尚未实测 待核验
中文界面
尚未实测 待核验
国内最后核验时间
尚未实测

许可与国内使用

仓库代码采用 Apache License 2.0(根目录 LICENSE 文件)。该许可适用于仓库代码本身,不覆盖第三方模型、外部推理服务、Zylon 商业模块或托管服务;这些需分别核验其许可与条款。

国内使用方面,README 未声明对中国大陆网络的专门支持或加速;安装命令涉及 brew、astral.sh、wheels.privategpt.dev 等境外域名,实际可达性与速度需自行核验。README 示例中的 Ollama 模型(qwen3.5:35b、mxbai-embed-large)仅为示例,并未声明对国内模型的兼容结论;是否适配其他国内模型取决于所选推理服务是否实现 OpenAI 兼容接口,需实测确认。

文档站点为 docs.privategpt.dev,官网为 zylon.ai;域名不等同于服务部署地域。

项目资料与来源

官方网站 ↗

GitHub 仓库 ↗

官方文档 ↗

字段依据与待核验事项

access:来源确认 · uv tool install --python 3.11 \ --find-links https://wheels.privategpt.dev/packages/ \ "private-gpt[core]"

project_type:来源确认 · PrivateGPT is the open-source API layer that turns local models into production AI applications.

原始 README(折叠技术参考)
![Banner image](./fern/docs/assets/privategpt_banner.png)

<div align="center">

**PrivateGPT is the open-source API layer that turns local models into production AI applications.**

[![Tests](https://github.com/zylon-ai/private-gpt/actions/workflows/tests.yml/badge.svg)](https://github.com/zylon-ai/private-gpt/actions/workflows/tests.yml?query=branch%3Amain)
[![Website](https://img.shields.io/website?up_message=check%20it&down_message=down&url=https%3A%2F%2Fdocs.privategpt.dev%2F&label=Documentation)](https://docs.privategpt.dev/)
[![Discord](https://img.shields.io/discord/1164200432894234644?logo=discord&label=PrivateGPT)](https://discord.gg/F8KCFeZbkx)
[![X (formerly Twitter) Follow](https://img.shields.io/twitter/follow/ZylonPrivateGPT)](https://twitter.com/ZylonPrivateGPT)

<a href="https://trendshift.io/repositories/8691" target="_blank"><img src="https://trendshift.io/api/badge/repositories/8691" alt="zylon-ai%2Fprivate-gpt | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>

</div>

---

Running a model locally is only the first step. To build useful AI applications you need a set of higher-level building blocks. PrivateGPT provides that layer as an open-source API following the Claude API model — so you can build private AI products without rebuilding the same backend primitives from scratch, and without depending on cloud APIs.

Production-tested: [PrivateGPT powers Zylon](#privategpt-vs-zylon), the on-premise AI platform providing Private AI to enterprises across the globe.


```text
Your app / agent / workflow / UI
              |
        PrivateGPT API
              |
OpenAI-compatible inference server (Ollama, llama.cpp, vLLM, …)              
```

> PrivateGPT does **not** run models itself. It connects to any OpenAI-compatible inference server via `OPENAI_API_BASE`. If it implements `/v1/chat/completions` and `/v1/models`, it works.

PrivateGPT ships a built-in workbench UI for testing and demos, available at `/ui`. The API is the actual product.

---

## What PrivateGPT gives you

- Standard messages API (streaming, async, token counting)
- File and artifact ingestion
- Retrieval with citations and agentic RAG
- Built-in tools mirroring the Claude API (web search, web fetch, code execution)
- Custom tools and MCP connectors
- Structured access to databases and CSVs
- Embeddings and orchestration

---

## Quickstart

> For Docker, full installation options, and model configuration see the [full Quickstart guide](https://docs.privategpt.dev/getting-started/quickstart).

**Prerequisites:** You need a running OpenAI-compatible LLM server. [Ollama](https://docs.privategpt.dev/providers/ollama) is the easiest starting point.

**1. Install PrivateGPT**

```bash
# macOS
brew tap zylon-ai/tap
brew install private-gpt
```

```bash
# Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

uv tool install --python 3.11 \
  --find-links https://wheels.privategpt.dev/packages/ \
  "private-gpt[core]"
```

```powershell
# Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

uv tool install --python 3.11 `
  --find-links https://wheels.privategpt.dev/packages/ `
  "private-gpt[core]"
```

**2. Start your LLM server**

```bash
# Example with Ollama
ollama pull qwen3.5:35b         # LLM (~24 GB)
ollama pull mxbai-embed-large   # Embeddings (~670 MB)
ollama serve
```

**3. Run PrivateGPT**

```bash
# macOS / Linux
OPENAI_API_BASE=http://localhost:<llm-port>/v1 \
  OPENAI_EMBEDDING_API_BASE=http://localhost:<embedding-port>/v1 \
  private-gpt serve
```

```powershell
# Windows (PowerShell)
$env:OPENAI_API_BASE = "http://localhost:<llm-port>/v1"
$env:OPENAI_EMBEDDING_API_BASE = "http://localhost:<embedding-port>/v1"
private-gpt serve
```

**4. Open the UI**

Go to [http://localhost:8080/ui](http://localhost:8080/ui). The API is at `http://localhost:8080` and follows the [Anthropic API](https://docs.privategpt.dev/api-reference/api-reference) spec.

<img src="./fern/docs/assets/ui.png"/>

The UI is useful for:

- Sending messages.
- Selecting models from /v1/models.
- Uploading documents.
- Testing retrieval with citations.
- Enabling tools per chat.
- Configuring databases, MCP connectors, skills, and custom tools.
- Inspecting requests and responses through the API Debugger. 

This UI is a demonstrator, not the core product. Developers are expected to build their own applications on top of the API. That said, the UI is intentionally polished enough for demos, videos, internal pilots, and quick local usage.

---

## Integrations

| | | |
|:-------------------------:|:-------------------------:|:-------------------------:|
|[![claude cowork](./fern/docs/assets/claude_cowork_privategpt.png)](./fern/docs/assets/claude_cowork_privategpt.png)<br/>**Claude Desktop / Cowork**|[![ms excel claude](./fern/docs/assets/ms_excel_claude_privategpt.png)](./fern/docs/assets/ms_excel_claude_privategpt.png)<br/>**Microsoft Excel Claude add-in**|[![ms word claude](./fern/docs/assets/ms_word_claude_privategpt.png)](./fern/docs/assets/ms_word_claude_privategpt.png)<br/>**Microsoft Word Claude add-in**|
|[![n8n](./fern/docs/assets/n8n_privategpt.png)](./fern/docs/assets/n8n_privategpt.png)<br/>**n8n**|[![opencode](./fern/docs/assets/opencode_privategpt.png)](./fern/docs/assets/opencode_privategpt.png)<br/>**OpenCode**|[![privategpt workbench](./fern/docs/assets/privategpt_workbench.png)](./fern/docs/assets/privategpt_workbench.png)<br/>**PrivateGPT Workbench**|

PrivateGPT works natively as the local backend for the tools developers and end users already use.

| Integration Guide | What it enables |
|---|---|
| **[Claude Code](https://docs.privategpt.dev/integrations/claude-code)** | Use your local models as the backend for agentic coding in the terminal |
| **[Claude Desktop / Cowork](https://docs.privategpt.dev/integrations/claude-desktop)** | Connect the Claude desktop app and Cowork to your private models |
| **[Claude for Microsoft 365](https://docs.privategpt.dev/integrations/claude-office)** | Run private AI inside Word, Excel, Outlook, and PowerPoint |
| **[OpenCode](https://docs.privategpt.dev/integrations/opencode)** | Local AI coding assistant in the terminal |


Any tool that works with a local OpenAI-compatible provider will also work with PrivateGPT. The list below is non-exhaustive.

| Tool | Link |
|---|---|
| n8n | [n8n.io](https://n8n.io) |
| OpenClaw | [openclaw.ai](https://openclaw.ai) |
| Hermes Agent | [hermes-agent.dev](https://hermes-agent.dev) |
| VS Code | [code.visualstudio.com](https://code.visualstudio.com) |
| Cline | [cline.bot](https://cline.bot) |


---

## Claude API compatibility

PrivateGPT follows the Claude API as the reference for modern AI application APIs. The goal is full coverage where it makes sense for a local, open-source layer.

| Area | Capability | Claude API | PrivateGPT |
|---|---|:---:|:---:|
| Models | Model selection | ✅ | ✅ |
| Messages | Messages API | ✅ | ✅ |
| Messages | Streaming | ✅ | ✅ |
| Messages | Batch / async processing | ✅ | ✅ async |
| Messages | Token counting | ✅ | ✅ |
| Knowledge | Files / artifacts | ✅ | ✅ |
| Knowledge | PDF and document ingestion | ✅ | ✅ |
| Knowledge | Retrieval with citations | ✅ | ✅ |
| Knowledge | Embeddings | ✅ | ✅ |
| Tools | Tool use | ✅ | ✅ |
| Tools | Tools in streaming | ✅ | ✅ |
| Tools | Built-in web search | ✅ | ✅ |
| Tools | Web extraction / fetch | ✅ | ✅ |
| Tools | Custom tools | ✅ | ✅ |
| Data | Database querying | Via tools | ✅ built-in |
| Data | CSV / tabular analysis | Via tools / code | ✅ built-in |
| Agents | MCP in the API | ✅ | ✅ |
| Agents | Remote MCP servers | ✅ | ✅ |
| Agents | Skills | ✅ | ⚙️ basic |
| Output | Structured outputs | ✅ | ✅ inference-dependent |
| Models | Vision | ✅ | ✅ model-dependent |
| Optimization | Prompt caching | ✅ | ❌ |
| Reasoning | Extended thinking | ✅ | ✅ |
| Platform | Token-based auth | ✅ | ✅ |
| Platform | OAuth / organizations | ✅ | ❌ |

✅ Supported · ⚙️ Partial / in progress · ❌ Not supported

Contributions are especially welcome in ⚙️ areas.

---

## Why PrivateGPT? A brief history

PrivateGPT started as a proof of concept in 2023: a script that let you chat with your documents, fully offline, with no data leaving your machine. It went viral on GitHub, crossed 50K stars, and became one of the most-watched AI repos of that year.

That early version made one thing clear: there was serious demand for private, local AI that worked without cloud dependencies.

PrivateGPT 1.0 is the evolution of that idea — rebuilt from the ground up as a proper API layer for private AI applications. 

<!-- Read the [PrivateGPT 1.0 launch post](https://blog.zylon.ai/privategpt-launch) for context on where it started and why. -->

<a href="https://star-history.dera.page/#zylon-ai/private-gpt&type=date&legend=top-left">
 <picture>
   <source media="(prefers-color-scheme: dark)" srcset="https://star-history.dera.page/svg?repos=zylon-ai/private-gpt&type=date&theme=dark&legend=top-left" />
   <source media="(prefers-color-scheme: light)" srcset="https://star-history.dera.page/svg?repos=zylon-ai/private-gpt&type=date&legend=top-left" />
   <img alt="Star History Chart" src="https://star-history.dera.page/svg?repos=zylon-ai/private-gpt&type=date&legend=top-left" />
 </picture>
</a>

---

## How PrivateGPT compares

### vs Ollama, LM Studio, LocalAI, vLLM, llama.cpp

These projects make it possible to run and serve models locally. They answer: *how do I run a model?*

PrivateGPT answers the next question: *how do I build a useful AI application on top of that model?*

```text
Ollama / LM Studio / LocalAI / vLLM / llama.cpp  =  local inference layer
PrivateGPT                                        =  local AI application API layer
```

Use them together. Run your model with whichever inference server you prefer, then point PrivateGPT at it.

### vs Onyx, Open WebUI

Both are valuable, but they are app-first experiences focused on chat and enterprise search. PrivateGPT is API-first. It provides the standardized local backend underneath those products — not the final product itself.

```text
Onyx / Open WebUI  =  self-hosted AI applications
PrivateGPT         =  API layer for building self-hosted AI applications
```

---


## PrivateGPT vs Zylon

<a href="https://www.zylon.ai/" target="_blank"><img src="./fern/docs/assets/zylon_banner.png"/></a>

PrivateGPT is maintained by the team at [Zylon](https://zylon.ai/).

**PrivateGPT** is the open-source application API layer: messages, ingestion, tools, retrieval, citations, database access, tabular analysis, MCP, skills, and custom tools.

**Zylon** is the end-to-end AI Infrastructure orchestrating the hardware and software layers into a complete production platform for regulated organizations. On top of PrivateGPT, Zylon adds:

- Integrated inference server based on NVIDIA Triton + vLLM to run open-weight models.
- Concurrency, batch processing and load balancing capabilities to operate at scale.
- Kubernetes self-contained deployment with 20+ production services packaged and supported.
- CLI for installation, updates, model selection, and platform configuration.
- API gateway for governance and developer platform.
- Workspace application for non-technical end users.
- LDAP/Active Directory integration and RBAC user management.
- Telemetry, observability and operational monitoring.
- SIEM audit logs for compliance.
- SharePoint, Confluence, FTP, and Samba connectors.
- Disconnected (air-gapped) operation without external cloud dependencies.
- Integrated n8n Community Edition for workflow automation.

Use **PrivateGPT** if you want the open-source local AI application layer and developer API.

Use **Zylon** if you need the full enterprise AI infrastructure around it: deployment, governance, operations, user management, integrations, auditability, and support.

[Learn more at zylon.ai](https://zylon.ai) · [Book a demo](https://cal.com/zylon/demo?source=privategptreadme)

---

## Community and contributing

- [Discord](https://discord.gg/F8KCFeZbkx) — questions, show-and-tell, and release discussions
- [Documentation](https://docs.privategpt.dev/) — full reference, guides, and API docs
- [Issues](https://github.com/zylon-ai/private-gpt/issues) — bug reports and feature requests
- [Community Forks](https://docs.privategpt.dev/community/forks) — interesting forks and derivatives by the community

Pull requests are welcome. If your PR doesn't fit the upstream roadmap, you can [add your fork to the Community Forks page](https://docs.privategpt.dev/community/forks) instead.
历史前置条件说明(补充参考)

需要正在运行的 OpenAI 兼容 LLM 推理服务(如 Ollama、llama.cpp、vLLM);macOS 用 brew,Linux/Windows 用 uv 与 Python 3.11;通过 OPENAI_API_BASE 与 OPENAI_EMBEDDING_API_BASE 环境变量接入;实际模型权重、硬件资源、API Key(如推理服务要求)、费用与是否支持国内网络均待自行核验。

项目来源与清单版权许可

https://github.com/zylon-ai/private-gpt/

整理来源:https://github.com/slavakurilyak/awesome-ai-agents

清单版权与许可:

MIT License

Copyright (c) 2024 Slava Kurilyak

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.