private-gpt README

The project's README from github.com/zylon-ai/private-gpt. As one markdown file: README.md.

Banner image

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

Tests Website Discord X (formerly Twitter) Follow

zylon-ai%2Fprivate-gpt | Trendshift


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, the on-premise AI platform providing Private AI to enterprises across the globe.

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


Quickstart

For Docker, full installation options, and model configuration see the full Quickstart guide.

Prerequisites: You need a running OpenAI-compatible LLM server. Ollama is the easiest starting point.

1. Install PrivateGPT

# 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 -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

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

3. Run PrivateGPT

# macOS / Linux
OPENAI_API_BASE=http://localhost:<llm-port>/v1 \
  OPENAI_EMBEDDING_API_BASE=http://localhost:<embedding-port>/v1 \
  private-gpt serve
# 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. The API is at http://localhost:8080 and follows the Anthropic API spec.

The UI is useful for:

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
Claude Desktop / Cowork
ms excel claude
Microsoft Excel Claude add-in
ms word claude
Microsoft Word Claude add-in
n8n
n8n
opencode
OpenCode
privategpt workbench
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 Use your local models as the backend for agentic coding in the terminal
Claude Desktop / Cowork Connect the Claude desktop app and Cowork to your private models
Claude for Microsoft 365 Run private AI inside Word, Excel, Outlook, and PowerPoint
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
OpenClaw openclaw.ai
Hermes Agent hermes-agent.dev
VS Code code.visualstudio.com
Cline 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.

Star History Chart

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?

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.

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

PrivateGPT vs Zylon

PrivateGPT is maintained by the team at Zylon.

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:

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 · Book a demo


Community and contributing

Pull requests are welcome. If your PR doesn't fit the upstream roadmap, you can add your fork to the Community Forks page instead.

private-gpt (zylon-ai/private-gpt)

Searching Database…

这是什么?PrivateGPT 是一个开源的 API 层,可以把任何本地的、兼容 OpenAI 的模型变成功能完整、可用于生产环境的 AI 应用后端,涵盖 RAG、工具调用、MCP、text-to-sql 等功能。
PrivateGPT 是像 Ollama 那样的模型运行工具,还是别的东西?它不是推理引擎,本身不运行模型。它连接到任何兼容 OpenAI 的推理服务(例如 Ollama、vLLM、LocalAI),这些服务需要提供 /v1/chat/completions 和 /v1/models 接口,并在其上构建一套 Claude 风格的 API。
怎样才能把它跑起来?安装 PrivateGPT,启动一个兼容 OpenAI 的大模型服务(Ollama 是最简单的选择),运行 PrivateGPT,然后在 /ui 打开内置的工作台界面,就可以发送消息、上传文档并测试检索效果。
开始之前需要先有推理服务吗?需要。你必须单独运行一个兼容 OpenAI 的大模型服务;推荐使用 Ollama,它是最容易上手的选择。
它已经完全支持 Claude API 的所有功能了吗?还没有完全支持:Skills 功能目前只是基础版,仍在开发中;提示词缓存暂不支持;也没有 OAuth 或组织级认证,目前只提供基于 token 的认证。
它能在任何操作系统上运行,还是只能在 Linux 服务器上用?它以 Python 项目的形式发布,并提供 Docker 镜像,只要有 Docker 或 Python 环境,就可以在 Linux、macOS 或 Windows 上运行;快速开始和 Docker 说明中都没有把它限制在某一个操作系统上。
我的数据会离开我的电脑吗?这个项目从一开始就明确主打离线优先:最初的 PrivateGPT 允许你完全离线地与文档对话,数据不会离开你的机器,而这个 API 层保留了同样的本地优先模式。
PrivateGPT 和直接运行 Ollama 或 vLLM 有什么不同?Ollama、vLLM、LocalAI 和 llama.cpp 解决的是“怎样运行一个模型”的问题。PrivateGPT 解决的是下一个问题:“怎样在这个模型之上构建一个应用”。你可以用上述任何工具运行模型,然后让 PrivateGPT 连接到它。
PrivateGPT 和 Zylon 是什么关系?PrivateGPT 是由 Zylon 团队维护的开源 API 层。Zylon 是基于它构建的商业化端到端企业平台,额外提供集成的推理服务器、Kubernetes 部署、RBAC、SIEM 审计日志以及离线隔离运行等功能。
这次重写之前的 PrivateGPT 是什么样的?它始于 2023 年,最初是一个简单的概念验证脚本,用于完全离线地与文档对话,后来广泛传播,GitHub 星标超过 5 万。当前版本是从零开始重建的正式生产级 API 层。
哪些工具可以把 PrivateGPT 当作本地 AI 后端接入?Claude Desktop/Cowork、适用于 Microsoft 365 的 Claude(Word/Excel/Outlook/PowerPoint)、Claude Code、n8n、OpenCode、OpenClaw、Hermes Agent、VS Code 和 Cline,都可以把 PrivateGPT 当作即插即用的本地兼容 OpenAI 后端来使用。
Creator
zylon-ai
Size
221.4 MB
Stars
57.6K
Age
3y
Commits · 90 Days