# private-gpt

> Open-source API layer for building private AI apps on local models with RAG, tools and MCP.

- Type: agent or tool
- Field: ML & AI
- Repository: https://github.com/zylon-ai/private-gpt
- GitHub stars: 57641
- Licence: Apache-2.0
- Language: Python
- Last push: 2026-11-23
- Page: https://imutechz.in/agents/private-gpt

## What it is
PrivateGPT is an open-source API that sits between your application and a local model server. It does not run models itself; it connects to any OpenAI-compatible inference server such as Ollama, llama.cpp or vLLM. It provides retrieval with citations, file ingestion, tools and MCP connectors, and includes a workbench UI at /ui for testing.

## Features
- Messages API with streaming and token counting
- File ingestion and retrieval with citations
- Built-in web search, web fetch and code execution tools
- Custom tools and MCP connectors
- Access to databases and CSVs
- Workbench UI with an API debugger

## Best for
- Building private AI applications
- Using local models with RAG
- Local backend for tools like Claude Code

## Pros
- Works with any OpenAI-compatible server
- Apache-2.0 licensed
- API follows the Anthropic API spec

## Cons
- Needs a separate running LLM server

## Install
```
brew tap zylon-ai/tap
brew install private-gpt
```

## Usage
```
private-gpt serve
```

Tags: private-ai, rag, local-llm, api, mcp, on-premise, ollama, python
